none
Microsoft Excel error '800a03ec'

    Question

  • Hi!
      I'm trying open an xls file, in ASP. But it throws an error, my code is below..
    <%
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Open("C:\xls\Book1.xls")
    objExcel.Workbooks.Close
    %>

    And I get this error
    Microsoft Office Excel error '800a03ec' Microsoft Office Excel cannot access the file 'C:\xls\Book1.xls'. There are several possible reasons: • The file name or path does not exist. • The file is being used by another program. • The workbook yo


    Please help, I've tried everything but nothing helped.

    Rashdan
    Thursday, March 18, 2010 9:37 AM

Answers

  • First of all, note that this forum is for .Net code, and you are presenting code for classic ASP.  Second:  The file does not exist in the web server or is not accessible to the account that runs the ASP server.
    MCP
    • Marked as answer by SamAgain Monday, March 29, 2010 2:58 AM
    Thursday, March 18, 2010 9:14 PM
  • Hi, Rashdan:

        A quick suggestion would be putting the xls file in your web server directory. Then change your code to open that xls file with server path.


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Marked as answer by SamAgain Monday, March 29, 2010 2:59 AM
    Monday, March 29, 2010 2:59 AM

All replies

  • First of all, note that this forum is for .Net code, and you are presenting code for classic ASP.  Second:  The file does not exist in the web server or is not accessible to the account that runs the ASP server.
    MCP
    • Marked as answer by SamAgain Monday, March 29, 2010 2:58 AM
    Thursday, March 18, 2010 9:14 PM
  • Thanks webJose for the reply, actually I couldn't find the proper ASP Classic forum. The file exists on the webserver and is accessible to the account that runs the ASP Server. Please, explain more how could I solve it ???

    /Rashdan


    Rashdan
    Friday, March 19, 2010 10:50 AM
  • Hi.  I don't think I can explain further.  It is really just that.  If the file exists, then it must be a permissions issue.  What account is IIS using in the application pool for your website?  I don't remember clearly right now if classic ASP uses SYSTEM or NETWORK SERVICE.  Or you might be using impersonation, in which case the access rights must go to the end user's account.  Use the Effective Permissions tool to verify that the account has read access to the file.
    MCP
    Friday, March 19, 2010 2:06 PM
  • Hi, Rashdan:

        A quick suggestion would be putting the xls file in your web server directory. Then change your code to open that xls file with server path.


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Marked as answer by SamAgain Monday, March 29, 2010 2:59 AM
    Monday, March 29, 2010 2:59 AM