[python-win32] Issue with refresh of ODBC linked table and submitting credentials in excel using Python

Carl E. Evans carl.evans28 at gmail.com
Mon Jun 22 16:56:48 CEST 2015


I have the following code:

import win32com.clientimport os


file1= r'C:\\Users\file.xlxm'
def refresher():
    if os.path.exists(file1):
        xl = win32com.client.DispatchEx("Excel.Application")
        xl.Workbooks.Open(Filename=file1,ReadOnly=1)
        xl.Visible = 1



        xl.Workbooks(1).Close(SaveChanges=1)
        xl.Application.Quit()
        del xl
refresher()

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?

This will allow me to quickly update my models without have to do it
manually in excel.

Thanks!

-- 
-----

Carl E. Evans | Economist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20150622/06f7a4da/attachment.html>


More information about the python-win32 mailing list