Home > Software engineering >  GetObject function in VB6 can only obtain the active object, can the object of all open.
GetObject function in VB6 can only obtain the active object, can the object of all open.

Time:11-19

Such as the current open multiple Excel program at the same time, use this code Set ExcelApp=GetObject (" Excel. Application "), can only access to an object, all can't get!

CodePudding user response:

Can only get the current object, I tried too much, can't get more, can only get one, there is a comma in brackets cannot little, or you will quote us "automation error"

CodePudding user response:

You have to know the corresponding file path already open all instances;
As the first parameter is the path to the file;
But I haven't tried, not sure if feasible;
 
The set excelapp1=getobject (" c: \ 1. XLS ", "excel. Application")
The set excelapp2=getobject (" c: \ 2. XLS ", "excel. Application")
The set excelapp3=getobject (" c: \ 3. XLS ", "excel. Application")
'...
  • Related