This project has moved. For the latest updates, please go here.
1
Vote

Start multiple Excel instances

description

Hi,

Is it possible to start multiple Excel instances with NetOffice?
When using the default COM way with new Application, the ROT will always return the instance that had been created at last. Two possible solutions:
  • When I start the Excel instance on my own (also to avoid loading AddIns that I dont need) I get an Interop.Excel Application instance. I would like to pass it over to NetOffice and initialize NetOffice with that interop instance. Is that possible?
  • Starting Excel instance with/ without addins via net office.
Many thanks
Holger

comments

SebastianDotNet wrote Dec 14, 2016 at 7:24 AM

NetOffice spend a ROT bypass if you want.
It is a static method on Excel.Application which is called GetActiveInstances.
(This method use the IAccessible interface by enumerate all windows on the desktop)

You can wrap an interop proxy like this:
NetOffice.ExcelApi.Application app = new NetOffice.ExcelApi.Application(null, interopProxy);

*Sebastian