Thanks rorya for prompt reply.
When GetObject is called without any Excel running :
Excel application is started (process) but without any window (or workbook)
When GetObject is called with an Excel running, but not the one referenced :
Vb net binds to the oldest Excel application (I will call this ghost)
The Excel ghost appears to have a new workbook with the reference name in getObject
All references in the bound Excel are actually to the original ghost workbook so
writing to the bound Excel places values in the ghost!!
I don't know what happens if there are several workbooks opened in the ghost Excel.
Since I can easily tell when there is no Excel the problem remains :
How can I tell this ghost is not the Excel I am seeking?
Listing the sheet names does not work as the user has 'standard' books with all the same sheet names.
Regards
mike
Main Topics
Browse All Topics





by: roryaPosted on 2009-02-06 at 03:38:58ID: 23568760
In VB6 (and VBA) I would expect GetObject to open the document if it is not already open, and return to you a reference to the application that now contains the document. Does that not happen in .Net? If not, I suspect you would have to find each Excel application's window (XLMAIN) then loop through each child window to see if the caption matches the book you want.