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

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Create an Excel Object from ASP code (Windows XP; Office 2003)

    Author
    Topic
    #436105

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #1032823

      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)

      • #1032836

        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.

        • #1032850

          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.

          • #1032861

            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.

    Viewing 0 reply threads
    Reply To: Create an Excel Object from ASP code (Windows XP; Office 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: