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:
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()
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
[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
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