Solved

System.Exception: Cannot create ActiveX component

Posted on 2011-02-13
2
1,732 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

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…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

691 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