Solved

System.Exception: Cannot create ActiveX component

Posted on 2011-02-13
2
1,725 Views
Last Modified: 2013-11-25
Running .IIS 7.0 Windows 2008 R2
Error on this line oexcel = CreateObject("Excel.Application")

When running the application on the server.  Does this mean I need Excel 2010 installed on the server?
0
Comment
Question by:IandINSW
2 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34888843
If that is server-side code then yes. It may also be a problem with permissions for the account running your code. But if you don't have Excel installed on the server then that is your first step.
0
 
LVL 17

Accepted Solution

by:
Jesse Houwing earned 125 total points
ID: 34889821
See: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/b401459a-d14a-4517-b204-fe7c0f5b1f83/

n important reminder:

Office COM automation in a server environment is fully-*un*-supported.

Please read the following document on reasons why and alternatives:

http://support.microsoft.com/kb/257757

Also note that is you decide to run office on the server, you'll need to ensure your licenses are in order. You might need a Office licenses for every user that might cause the office automation to run, which can be very costly if your application is available through the internet or to 3rd parties.

Next to the Microsoft provided alternatives, there are a number of 3rd party components that allow office automation tasks and usually stay pretty close to the Word API to make conversion of your code relatively easy. I've worked with Aspose components for this purpose in the past and can recommend them (http://www.aspose.com/categories/.net-components/aspose.words-for-.net/default.aspx).

The same applies to Excel, Aspose.Cells or Excel Package Plus (http://epplus.codeplex.com/) are components I've worked with in the past and I can recommend them.

Sharepoint now offers Excel and Word automation services that dont require Office to be installed on the server. See:
http://channel9.msdn.com/Blogs/matthijs/SharePoint-2010-Based-Document-Assembly-and-Manipulation-Using-Word-Automation-Services-and-Open-XML
http://msdn.microsoft.com/en-us/library/ee558830.aspx
http://msdn.microsoft.com/en-us/library/ms517343.aspx
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question