Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

System.Exception: Cannot create ActiveX component

Posted on 2011-02-13
2
Medium Priority
?
1,769 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 500 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

972 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