<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px">I have the following code:</p><pre class="" style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">import</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> win32com</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">client
</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">import</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> os


file1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> r</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'C:\\Users\file.xlxm'</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">

</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">def</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> refresher</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">():</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">if</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> os</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">exists</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">file1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">):</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        xl </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> win32com</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">client</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">DispatchEx</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"Excel.Application"</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        xl</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Workbooks</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Open</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Filename</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">file1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">ReadOnly</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        xl</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Visible</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">



        xl</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Workbooks</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">).</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Close</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">SaveChanges</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        xl</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Application</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Quit</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">del</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> xl
refresher</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px">Which gets me into the file, but I am unsure of how to refresh a ODBC connected table that requires a simple form submission of user credentials. The current settings dont allow me to save credentials so a script seems to be the only solution. Any suggestions?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px">This will allow me to quickly update my models without have to do it manually in excel.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px">Thanks!</p><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><font face="courier new,monospace">-----</font></div><div><font face="courier new,monospace"></font> </div><div><font face="courier new,monospace">Carl E. Evans | Economist</font></div><div> </div><div> </div></div></div>
</div>