andryt29
13 years agoOccasional Contributor
How to get Multiple Excel Instance by Com
Hi everybody,
I want to get a specific instance of excel to get a specific worbook opened in this instance and save this worbook.
But when I use a TestComplete OleObject or ActiveXObject, I just take an instance of excel that I don't want. (maybe the Active Instance)
I have many excel instances opened with one or many workbook opened in these instances.
I was trying
var oExcel = GetObject("","Excel.Application");
and
var oExcel = Sys.OleObject("Excel.Application")
and
var oExcel = new ActiveXObject("Excel.Application");
but it doesn't work because I get an instance of Excel that I don't want.
Have you another method to get all excel instances which works with Com Object because I want to save an Workbook with the com method like oWorkBook.SaveAs("C:\myPath..........")?
Can you help me?
Thanks
I want to get a specific instance of excel to get a specific worbook opened in this instance and save this worbook.
But when I use a TestComplete OleObject or ActiveXObject, I just take an instance of excel that I don't want. (maybe the Active Instance)
I have many excel instances opened with one or many workbook opened in these instances.
I was trying
var oExcel = GetObject("","Excel.Application");
and
var oExcel = Sys.OleObject("Excel.Application")
and
var oExcel = new ActiveXObject("Excel.Application");
but it doesn't work because I get an instance of Excel that I don't want.
Have you another method to get all excel instances which works with Com Object because I want to save an Workbook with the com method like oWorkBook.SaveAs("C:\myPath..........")?
Can you help me?
Thanks