locked
ASP compatibility mode error while creating Excel file using CreateObject(“XLSpeedGen.ASP”) RRS feed

  • Question

  • User1283596549 posted

    When I am trying to create an Excel file using below code in my local machine (64-bit machine), I am getting below error.

    <%@ Page ASPCompat="True" language="vb" %>

    Dim
    XLS ' Excel SpeedGen Object XLS = Server.CreateObject("XLSpeedGen.ASP") <--- I am getting the error in this line XLS.AddVariable("Name", strName) XLS.Generate(SrcBook, "", False)

    Exception Details:

    System.Web.HttpException: An error was encountered while calling OnStartPage in ASP compatibility mode.

    Stack Trace:

    [HttpException (0x80004005): An error was encountered while calling OnStartPage in ASP compatibility mode.]
    System.Web.Util.AspCompatApplicationStep.OnPageStart(Object component) +3028336 System.Web.HttpServerUtility.CreateObject(String progID) +142

    I have registered "XLSpeedGenASP.dll" using below code in my local machine.

    regsvr32 "E:\XLSpeedGen\XLSpeedGenASP.dll"

    Still I am getting the same error. How to resolve the above mentioned issue?

    Tuesday, February 12, 2019 5:23 PM

All replies

  • User839733648 posted

    Hi RGSenthil27,

    According to your description and code, I have some confusion.

    Which version of the framework you've used in the project?

    Could you please provide the XLSpeedGenASP.dll file because I could not find it by searching online?

    And I could not reproduce your issue without this.

    System.Web.HttpException: An error was encountered while calling OnStartPage in ASP compatibility mode.

    Besides, as far as I'm concerned, the error happens may be because there exists some conflicts between ASPCompat="True" and OnPageStart.

    I suggest that you could try to change the version of platform as x86 in VS.

    And this is my VS version.

    Best Regards,

    Jenifer

    Wednesday, February 13, 2019 8:05 AM