1

This problem is related to my previous question at Maximum number of excel processes?, but with different behavior.

In short: there is a COM+ component that opens a number of excel processes when it's started. The handles are added to a list, so they don't get out of scope or garbage collected.

If I run this component locally (windows 7 64 bit, 12 Gb of memory), it starts fine and it opens 30 excel processes without a problem.

If I run this component on a (virtual) server (windows server 2003 R2 SP2 64 bit, 4 Gb), then the first 21 excel processes are started correctly, but the remaining 9 processes are not created; and in the event log I see 9 times the following error:

 Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005.

So creating the last 9 excel processes result in exceptions, it seems to hit a limit of 21 excel processes.

If I try it on yet another server (Windows Server 2003 SP 2, 1 Gb RAM), it creates 22 excel processes, and 8 that fail with the same exception.

I'm wondering what is causing the excel process creation to fail on these servers?

EDIT: I can open 30 excel instances without problem if I manually open them using the start menu.

Any ideas?

Thanks, L

Community
  • 1
  • 1
L-Four
  • 13,345
  • 9
  • 65
  • 109
  • but just wondering why would u want that many processes? – nawfal Jun 25 '12 at 15:04
  • it's a server that processes calculations, and in order to 'cache' calculations we want most of them in memory (loading them each time takes too much time) – L-Four Jun 25 '12 at 15:07
  • Similar error found here with a few options to try: http://stackoverflow.com/questions/881132/retrieving-the-com-class-factory-for-component-failed – harlam357 Jun 25 '12 at 17:20
  • Is this page relevant for you: http://blogs.msdn.com/b/adioltean/archive/2005/06/24/432519.aspx? – Paul B. Jun 26 '12 at 07:23
  • I doubt it, because it consistently happens after 21 excel instances... it seems that it has nothing to do with heavy load. – L-Four Jun 26 '12 at 13:37

1 Answers1

0

Technically what you are doing isn't supported at all: http://support.microsoft.com/kb/257757

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

That said, because of the slight inconsistencies between servers, I beleive you are running into some sort of a resource conflict/limitation and not something specific to excel. With the limited amount of memory on the server, it could be simply running out of or fragmenting memory.

b_levitt
  • 7,059
  • 2
  • 41
  • 56
  • I know it's not supported, but it's legacy code that needs to be supported, so for now I can't change it to for example Excel Services. Concerning memory: how is it possible that on 1 gig it can create 22 instances and on 4 gig only 21? And I can open more that 25 excel files manually... – L-Four Jun 25 '12 at 15:13
  • These might be better comments for your original question but: What version of excel is this? Is it 32 or 64 bit? Is your process 32 or 64 bit? – b_levitt Jun 25 '12 at 16:01