automate Excel in server 2008


Jerry C

I have a web site that automates excel.
This site runs in server 2003. iis 6.0 office 2003 installed
I moved this app to server 2008 iis 7.0 office 2003 installed

Now when I try to automate excel I get the error
Retrieving the COM class factory for component with CLSID
{00024500-0000-0000-C000-000000000046} failed due to the following error:

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

The key is the CLSID. I cannot find it in the registry. I searched for it.

The component services com+ management console has the Microsoft excel
object in it but it has the
AppID 00020812-0000-0000-C000-000000000046.

I set permissions the same in both sites. App pool idenitites are the same.

I find some posts on the net but no solutions.

Hope someone can help.

Thank you,

\Ji Zhou [MSFT]\

Hello Jerry,

Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou
[MSFT] and I will be working on this issue with you.

As Mark already pointed, the Server Side Office Automation is not
recommended and supported from Microsoft because Office application is not
designed for such an objective. You can get the detailed information from
the KB article Mark posted.

As to this issue itself, technically speaking, we receive this error
because the Excel application can only be activated under the following

But in the Windows Server 2008 and IIS7, the ASP.NET work process w3wp.exe
runs under the NETWORK SERVICE account. So, you need to configure this
account in the Component Services MMC. You can get a detailed steps in the
following article. Note that we should add the NETWORK SERVICE account
instead of the ASPNET.

With the configuration in the above link, it works on my side. Please let
me know if this works for your not?

Have a nice day!

Best regards,
Ji Zhou ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

Get notification to my posts through email? Please refer to

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
This posting is provided "AS IS" with no warranties, and confers no rights.

Adrian Gallero

Mark said:
Why are you advising someone to try a totally unsupported hack...?

I work developing a third party component for creating Excel files
without OLE, so I mostly agree with you (except for the recommended
third party lib of course ;) )

But, not every situation is the same, and there are cases where the
only option is to automate Excel, as slow and crash-prone as that is.
For obvious reasons I am not familiar with the library you recommended
(I use mine), but let's imagine I want to run a macro in the server. Or
embed a flash activex and a word document inside the xls file. Or
create Excel files that query a database. Can I do it? (Sincere
question, as said I don't know this particular library) Or a million
features that Excel supports and that might not be supported by the

There *are* valid reasons why someone would want to go with ole
automation in the server (or even in the client, I don't think ole is
very good for client apps either). If you can deal with slowness, going
to the server and killing the hanging excel process once in a while,
and not many people is using the app, OLE can be a valid solution. Not
all apps are the same, and not everybody is google serving millions of
requests per second.

All this said, I myself wouldn't go with OLE Automation unless there is
no any other possible solution, and not just for servers, for clients

But for those cases, what Ji Zhou suggested is a valid and welcome

Kind Regards,

Adrian Gallero

No there aren't...

If you can run a macro in the server, that can also call activex
controls btw, then you have a huge security hole, and this solution
won't probably be better/more stable than automating Excel. The extra
stability you get with third party solutions sometimes comes from the
fact that they can't do anything Excel does.
Name one...

Are you *sure* you can do those things? I am not speaking about
creating files that have macros or embedded activex controls, I am
speaking about running those macros or having those activex work.

As said, I don't know about the components you posted, but I downloaded
their brochure and they say for example: You can also change the source
data of a Pivot Table at
runtime." But can you create a new pivot table from scratch? We can
also modify pivot tables, but in our case we won't allow you to create
a new one from 0. If they can, why isn't that mentioned? Why don't they
mention anything about running macros or activex controls?
And what will you do when it stops working, as it inevitably will?
Who will help you then? No point calling Microsoft...

As said, not all apps are the same. Sometimes it won't matter that it
will stop working. Maybe the app is going to be used for a transition
period for example. (while those xls files are transferred to the

I am doing kind of a devils advocate here, if I didn't think ole
automation is not the solution for serious apps I wouldn't be
developing an alternative. But not all apps are "serious" apps. you
would be amazaed at all the "throwaway" apps that are created in most

Adrian Gallero

Mark Rae [MVP] wrote:

Nice, but that is just one fature. I don't see anythinga bout macro
support yet, and actually, searching for macros in their forums you can
find this thread:

"We do not support to create or manage vba macros although you can
create a button control using Aspose.Cells APIs."

So, here we are not even speaking about running macros (my original
question), just creating them and it doesn't seem supported. Ok, the
thread is a year old, but I hightly doubt they added a full VBA
interpreter (besides ability to write macros) in that time, and that it
isn't advertized anywhere. And even if it did have its own VBA
interpreter, how good is it? Can it run anything Excel can?

So my point stands. If you can't run macros, you can't for example use
custom formulas (like all the functions in the "packs" that Excel
includes, finantial pack, etc). In our case, even when we won't run
macros, we offer the ability to define them in .net and they will be
used in the recalculation, but it is not the same. If you are using
hunderds of custom formulas anything but natively running macros would
not be an option. Even if you have to restart your server from time to

how about solver? Does this component implement the solver?

Well, I am tired of being devil's advocate. I think we actually mostly
agree, I believe third party solutions are best for 99% of the cases,
or I wouldn't be developing one. I just can't agree with:
No there aren't...

If you think world is so black and white and there are absolutely no
cases where you would need to automate the real Excel, I don't think
you have seen the spreadsheets I have. But well, to each his own.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Latest member

Latest Threads