Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jun 2002
    Location
    Georgia, U. S. A.
    Posts
    90
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Create an Excel Object from ASP code (Windows XP; Office 2003)

    I'm trying to create a spreadsheet from an ASP (old - not .NET) page by reading info from a database and then using Excel to display the results as a report. This comes from a test given to students and I want to give the teacher the grades. I use the code, "Set xlApp = CreateObject("Excel.Application")" but get an error message at that point. I know this used to work (4 years ago??) and don't know what has changed or how to fix it. The pertinent code I'm trying to use is attached in a Word document.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create an Excel Object from ASP code (Windows XP; Office 2003)

    Are you sure the error occurs on that line? It should work on a PC that has Excel installed.
    I would change the line

    Set xlWS = xlApp.Worksheets(1)

    to

    Set xlWS = xlWB.Worksheets(1)

  3. #3
    Star Lounger
    Join Date
    Jun 2002
    Location
    Georgia, U. S. A.
    Posts
    90
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Create an Excel Object from ASP code (Windows XP; Office 2003)

    Thanks Hans,
    Yes, I changed the code you suggested but I still get the same error:
    Microsoft VBScript runtime error '800a01ad'

    ActiveX component can't create object: 'Excel.Application'

    /CompApps/Stats.asp, line 34

    The code you suggested I change is on line 36 and I'm not getting that far.

  4. #4
    Star Lounger
    Join Date
    Jun 2002
    Location
    Georgia, U. S. A.
    Posts
    90
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Create an Excel Object from ASP code (Windows XP; Office 2003)

    One other question just dawned on me. This is server side script so I wonder if the server has anything to do with it. I'm not real sure how the server interacts with the client in this case. Does the server create the sheet and then send it to the client or does it somehow tell the client to create the sheet?
    J. P.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create an Excel Object from ASP code (Windows XP; Office 2003)

    As far as I know (but I'm not an expert in ASP etc.), the code will try to start Excel on the server. So if Excel hasn't been installed there, you'll get the error you mention.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •