Re: win32com: how to connect to a specific instance of a running object?

2006-06-02 Thread ago
solved, if it can be useful to others here is my code: import pythoncom import win32com.client def getWorkbook(workbookName): lenstr = len(workbookName) workbook = None rot = pythoncom.GetRunningObjectTable() rotenum = rot.EnumRunning() while True:

Re: win32com: how to connect to a specific instance of a running object?

2006-06-02 Thread ago
The other approach I tried (as suggested by Tim, thanks) involves browsing the ROT. import pythoncom SPREADSHEET_NAME = r'\MySpreadsheet.xls' lenstr = len(SPREADSHEET_NAME) obj = None rot = pythoncom.GetRunningObjectTable() rotenum = rot.EnumRunning() while True: monikers = rotenum.Next()

Re: win32com: how to connect to a specific instance of a running object?

2006-06-02 Thread ago
Thanks, after some further digging I hit something... The following seems to do the trick: import win32gui WINDOW_CLASS = 'XLMAIN' WINDOW_TITLE = 'Microsoft Excel - MySpreadsheet.xls' hwindow = win32gui.FindWindow(WINDOW_CLASS,WINDOW_TITLE) Now the next question is: how do I use the window-handle

RE: win32com: how to connect to a specific instance of a running object?

2006-06-02 Thread Tim Golden
[ago] | Is it possible to use win32com.client to connect to a | specific instance | of a running application? In particular I am interested in finding the | instance of excel which has a particular spreadsheet opened | considering | that there might be more instances of excel running at the | s

win32com: how to connect to a specific instance of a running object?

2006-06-01 Thread ago
Is it possible to use win32com.client to connect to a specific instance of a running application? In particular I am interested in finding the instance of excel which has a particular spreadsheet opened considering that there might be more instances of excel running at the same time. I need to take