Solved

System.Exception: Cannot create ActiveX component

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
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.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now