File to createobject. 'Excel.Application'



My web application works fine in my PC and create the excel sucessfully.
However, When I publish to the client server (Didn't got MS office), It
seems can't create excel .
Is that true ?

My Code is
Dim oSheet As Object
oExcel = Server.CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add

The error show as below :-
System.Web.HttpException: Could not create an object of type

Steven Cheng

Hi Sze,

Regarding on the issue, you are trying to deploy a web application that
contains code for creating Excel objects to another new server and found it
not work, correct?

As you mentioned that "Didn't got MS office", do you mean the new
deployment server doesn't have Office /Excel application installed? If this
is the case, I'm afraid the Excel object creation code you used will not
work since such kind of Office Automation code requires the Office
application be installed on the hosting system.

BTW, you use the Office automation code in web application, and this is not
recommended since using Office automation code in server-side application
might cause performance issue and unexpected error behavior. If your web
application will be accessed by large number of concurrent users, this is
really a big potential issue.

#Considerations for server-side Automation of Office


Steven Cheng

Microsoft MSDN Online Support Lead


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Latest member

Latest Threads