I have an application which deals with excel. Recently I encountered a problem with very slow creation of Excel object.
I\'ve recreated the issue with this s
I don't think the problem is with this constructor. Try to create the object dynamically:
var obj = Activator.CreateInstance(Type.GetTypeFromProgID("Excel.Application"));
Then cast it to Microsoft.Office.Interop.Excel.Application
:
var xlApp = (Microsoft.Office.Interop.Excel.Application)obj;
MessageBox.Show(xlApp.Name);
I'd expect the slow-down to move to the Activator.CreateInstance
call.
Anyway, you can try to work it around by placing the following into you app.config
file (more details):
I'd also suggest to make sure you're running the latest VSTO Runtime and the latest Office PIAs.