473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Invoking Excel COM object with CLSID is either not valid or not registered

RJN
Hi

I'm invoking the excel object from ASP.Net application. My development
machine is Windows 2000 and MS Office is installed on my m/c. I have
added reference to the Excel COM object, I have given Access and launch
permissions to ASPNET user in DCOMCNFG and the identity set to launch
user. But I get the following error, moment I try to create the Excel
object: Dim oexcel As New Excel.Application

"COM object with CLSID {00024500-0000-0000-C000-000000000046} is either
not valid or not registered"

The same DCOM config settings work fine in Windows xp.

Also I have observed that (in xp), the excel objects are still in memory
even after the application is terminated and I could see multiple such
objects in task manager. I close the excel object by calling quit. How
do I destroy the objects?

Regards

rjn


*** Sent via Developersdex http://www.developersdex.com ***
Apr 7 '06 #1
5 2741
2 things. Use the depends utility that ships with visual studio to examine
the excel object in order to determine if a dependency is failing.

Unregister the excel object and re-register it then run depends on it.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
-------------------------------------------------------

"RJN" <rj*@yahoo.com> wrote in message
news:uH**************@TK2MSFTNGP03.phx.gbl...
Hi

I'm invoking the excel object from ASP.Net application. My development
machine is Windows 2000 and MS Office is installed on my m/c. I have
added reference to the Excel COM object, I have given Access and launch
permissions to ASPNET user in DCOMCNFG and the identity set to launch
user. But I get the following error, moment I try to create the Excel
object: Dim oexcel As New Excel.Application

"COM object with CLSID {00024500-0000-0000-C000-000000000046} is either
not valid or not registered"

The same DCOM config settings work fine in Windows xp.

Also I have observed that (in xp), the excel objects are still in memory
even after the application is terminated and I could see multiple such
objects in task manager. I close the excel object by calling quit. How
do I destroy the objects?

Regards

rjn


*** Sent via Developersdex http://www.developersdex.com ***

Apr 7 '06 #2
Hi,

I don't know about the "not registered" question, but about the second:
Also I have observed that (in xp), the excel objects are still in
memory even after the application is terminated and I could see
multiple such objects in task manager. I close the excel object by
calling quit. How do I destroy the objects?


If you really need to use ole automation, in order to close Excel, you
need to free al Excel objects that you use, not only the application.
For example, if you are using a Range object, make sure that it is
released too. Any reference that is left will prevent Excel to close. I
am not sure, but if setting them to null does not help, you could try
by calling Marshal.ReleaseComObject on them.

I said "if you really need" because using OLE automation on the server
is not a very good idea. It is very easy to crash, to have security
issues, or just not close and keep the instances of Excel.exe growing
until the server runs out of memory.

From http://support.microsoft.com/kb/257757/en/
"
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, DCOM,
and NT Services), because Office may exhibit unstable behavior and/or
deadlock when run in this environment."
I would recommend you to look at an alternative solution. My company
develops one, at www.tmssoftware.com/go/?flexcelnet and I think it is
one of the better options out there for creating files that "just
work", but there are a lot of other options too. Just google for them.
If you need to pay just one Excel license to deploy on a server, any
third party solution will be less expensive.

Well, I am not sure if this helps, but maybe it does.
Best regards,
Adrian.
Apr 7 '06 #3
RJN
Thanks for your replies. I could not find any dependency checker in
VS.Net 2003. As I said I have installed Office 2003, so I think the
installation would have installed correctly all the dependent files. So
should I add reference to an other COM object other than Excel library?

*** Sent via Developersdex http://www.developersdex.com ***
Apr 8 '06 #4

Hallo,
I got the same problem a few days ago.
It was on a Win XP system with MS office 2003.

There were differend SLIDs for Excel.Application in the windows registry
(regedit) and in the dcom configuration (dcomcnfg).

The error message showed the SLID of the registry.

I modified the SLID in the registry to the SLID of dcomcnfg and it
worked.

With Kind regards,
yours David
*** Sent via Developersdex http://www.developersdex.com ***
May 26 '06 #5
Your first issue is about backwards compatability in .NET Interop, not
permissions.
Your second issue is probably permission related.
Please see the following articles which solve both issues, respectively:
1. "Achieving Backward Compatibility with .NET Interop: Excel as Case
Study" - http://www.devcity.net/Articles/163/1/article.aspx
2. "50 Ways to Kill Excel" -
http://www.devcity.net/Articles/239/1/article.aspx

--scott

"RJN" wrote:
I'm invoking the excel object from ASP.Net application. My development
machine is Windows 2000 and MS Office is installed on my m/c. I have
added reference to the Excel COM object, I have given Access and launch
permissions to ASPNET user in DCOMCNFG and the identity set to launch
user. But I get the following error, moment I try to create the Excel
object: Dim oexcel As New Excel.Application

"COM object with CLSID {00024500-0000-0000-C000-000000000046} is either
not valid or not registered"

The same DCOM config settings work fine in Windows xp.

Also I have observed that (in xp), the excel objects are still in memory
even after the application is terminated and I could see multiple such
objects in task manager. I close the excel object by calling quit. How
do I destroy the objects?

Jun 19 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Prasad Patil | last post by:
Hi, I have a asp.net/c# web application when i try to create the following excel object using the following code mentioned below I have Office 2003 installed on my PC, VS.Net 2003. but still it...
4
by: Ahmed | last post by:
i have tried running the csharpsite in my Microsoft Visual C#.net and after i hit the run button i keep getting the same error which is : Server Error in '/csharpsite' Application COM object with...
1
by: Cristina Malavasi | last post by:
Hi a have a COM dll made in C++ (I don't have the source code) I used tlbimp to create a managed .NET assembly dll... I reference this dll and import it with "using myDll" then I make an object...
6
by: Frank X | last post by:
Excel 2002 introduced a capability to add custom worksheet functions to Excel direct from a COM/ActiveX object. I can use C# to develop a COM object which I can use fine from Excel/VBA, however...
1
by: compassSoftware | last post by:
I am trying to work on an application that uses a dll as a COM object. I am coming in late to this project to administer/update the application. I notice in the References that a particular...
1
by: Jen | last post by:
Hi, I'm having an issue calling a dll from an ASP.NET page. The code that tries to instantiate a COM dll (class) is in a Class Library. I can call the code successfully from a windows...
2
by: Thomas Andersson | last post by:
Hi, I am trying to use a ActiveX Com component in a aspx web page. First I have made a reference to the .dll. I have also used aspCompat="true" in the page. Then I use the code below... ...
13
by: brianbasquille | last post by:
Hello all, Am trying to modify / update the existing open-source OpenHTPC. I've renamed most of the namespaces and some forms (as well as added my own with modifications) and everything works...
4
by: rjn | last post by:
Hi I'm invoking the excel object from ASP.Net application. My development machine is Windows 2000 and MS Office is installed on my m/c. I have added reference to the Excel COM object, I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.