File to createobject. 'Excel.Application'

Discussion in 'ASP General' started by Sze, Jul 28, 2010.

  1. Sze

    Sze Guest

    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
    'Excel.Application'.
     
    Sze, Jul 28, 2010
    #1
    1. Advertisements

  2. Sze

    Steven Cheng Guest

    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
    http://support.microsoft.com/kb/257757

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    --------------------
     
    Steven Cheng, Jul 28, 2010
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.