General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Automation of Multiple Instances
To start up, I tried starting up multiple instances of Excel and then using the following code to link them to an array of objects in my program.
do while SessionCount <= 4
BringWindowToTop lngHwnd(SessionCount)
SetActiveWindow lngHwnd(SessionCount)
On Error Resume Next
Set gdtpTEmp(SessionCount) =GetObject(, "EXCEL.Application")
If Err.Number <> 0 Then
Set gdtpTEmp(SessionCount) = CreateObject("EXCEL.Application")
End If
On Error GoTo 0
SessionCount = SessionCount + 1
Loop
here lngHwnd is an array of the window handles of the Excel Instances.
The problem is that even though I set active window for each instance, All the object in my program point only to the first Instance.
Does anyone have any Idea how to assign multiple instances to objects in the program? Is it Possible?