Solved

System.Exception: Cannot create ActiveX component

Posted on 2011-02-13
2
1,730 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
make control visible based off other control value 7 40
c#, datatable, aspx 4 45
CSS question 16 57
ASP.NET Load html part first, then start function 2 35
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This video teaches viewers about errors in exception handling.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

740 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