selecting a specific excel instance
Hi Henning,
If you know the full path to your file Text1.xls you can do something like
this -
Sub test()
Dim objWB As Object ' Excel.Workbook
Dim xlApp As Object ' Excel.Application
Set objWB = GetObject("C:\Temp\Test1.xls")
Set xlApp = objWB.Parent
End Sub
If your code is in Excel, or in some other app with a reference to Excel,
change 'As Object' to the appropriate Excel object type.
If you don't know the path it's much more difficult.
Regards,
Peter T
"Henning Winkler" wrote in message
ps.com...
Hi all,
I'm looking for a way, to catch a specific excel instance and use
their objects (fill in data f.e.) . I my case, there are several
excels (listed in the taskbar) - f.e.five - and I want to access the
instance with the title "Microsoft Excel - Test1.xls.". I tried that
with findwindow-api, but I think, a can't acess the excel object via
this window handle, right ?
Any idea to solve this problem ?
Thanks in advance
Henning
|