Is an opened Excel-Reference by TestComplete somehow hidden for other applications?
We have the following situation:
we start TestExecute 14 and get per OLEObject a reference to Excel.Application. We open a Workbook. An Excel-instance is opened with this Workbook. Another (Delphi) application opens and writes another Workbook. Both Workbooks appear in the same instance under Windows 7/Office 2010, so TestExecute can search the new Workbook in the only existing instance and work with it. So far so good.
Now we are using Windows 10/Office 2016: the Delphi-application opens another Excel instance instead of using the same instance of TestExecute!?! Is the TestExecute-Excel-Instance somehow hidden for other applications? We already set the registry entry 'disablemergeinstance' to 0, but this does not make any difference.
How can we search a Workbook in several instances? Or better, how can we make the TestExecute-Excel-Instance 'public'?
SOPTIM AG, Germany
Solved! Go to Solution.
/Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
thanks for the reply. Testcomplete is the first application which starts opening Excel-Workbooks. The other Delphi-application creates/fills Workbooks during testexcution. So no Excel-instance runs at Start...
Using OleObject('Excel.Application') creates a running Excel instance. So, as soon as you call that in TestComplete, a running instance is created. Hence, the article @AlexKaras posted still applies
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
After adding EXCEL7 in MSAA, the Property is visible not visible under
Sys.Process("EXCEL").Window("XLMAIN", "a - Excel", 2).Window("XLDESK", "", 1).Window("EXCEL6", "", 1). It is visble under Sys.Process("EXCEL").Window("XLMAIN", "a - Excel", 2).Window("XLDESK", "", 1).Panel("a"). Sys.Process("EXCEL").Window("XLMAIN", "a - Excel", 2).Window("XLDESK", "", 1).Window("EXCEL7", "", 1) has disappeared.
Instead of adding EXCEL7, I've added only EXCEL6 in MSAA: then the property is visible under Sys.Process("EXCEL").Window("XLMAIN", "a - Excel", 2).Window("XLDESK", "", 1).Window("EXCEL7", "a", 1) -- EXCEL 7 !!!!!!!!
Also, a Sys.Process("EXCEL").Window("XLMAIN", "", 3 exists though 2 files are opened, not 3...
I don't understand it.
the following works for me with EXCEL7 in MSAA (Windows 7/10 and Office 2016):
Sys.Process("EXCEL").Window("XLMAIN", "*", 1).Window("XLDESK", "*", 1).Panel("*").NativeObject.Application
With this property I have all original Properties/Methods like before.