I have an application that deals with excel. I recently ran into a problem with very slow creation of an Excel object.
I recreated the problem with this simple code:
Microsoft.Office.Interop.Excel.Application xlApp; xlApp = new Microsoft.Office.Interop.Excel.Application();
The second line causes a delay.
In order to measure the time required to host the new facility, the above code has been expanded with a time tracking solution, and the results are final. In the NORMAL situation above, the code is executed in 0.5 s, and in the case of FAULTY-BEHAVIOR this can take up to 5 minutes.
There are no memory leaks, and excel objects are properly freed. My solution works around the clock and without problems. I'm not sure if this is important, but the application runs on 20 separate user sessions (server machine). Thus, 20 instances of this application work simultaneously, and this can lead to simultaneous 20 instances of Excel.
The problem was first noticed 2 months ago and was resolved by updating Office (2010 โ 2013). This time I have more time for research, and, unfortunately, the results do not promise.
Facts:
- Only one machine is affected in this situation (24 processor cores, 24 GB RAM)
- The CPU is not stressed at all when there is a โdelayโ
- I tried using the "Process Monitor" application to check what happens when we create the "new Excel.Application ()" (to see if there is excessive disk / memory / processor usage) - there are no signs of resource limitations. There are no signs of log files associated with COM objects, etc.
- The only problem here is a few minutes of delay. All other Excel Interop commands work as usual.
The main question:
- Is there a way to debug this Microsoft.Office.Interop.Excel.Application () constructor to find out what part of the problem is here?
External content
EDIT - optional test
PowerPoint Designer is Delay-Free
ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
c # office-interop excel-interop
adrian.krzysztofek Jan 23 '14 at 13:57 2014-01-23 13:57
source share