Hi everyone i am getting an error that says Microsoft Office Excel error '800a03ec'
Unable to get the Open property of the Workbooks class when i try to open an excel work book in my code . The line of code where i get the error is Set ExcelBook = ExcelApp.Workbooks.open(BookPath) where BookPath is the path to the file .
The code before the line where the error is looks like this

Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Application.Visible = false 
BookPath = "c:\filename.xls"  
Set ExcelBook = ExcelApp.Workbooks.open(BookPath)

please help and thank you in advance

Dani AI

Generated

This error is typically a permissions/automation issue, not a bad path. Excel COM automation from Classic ASP runs under a non‑interactive account (IUSR/Network Service/app pool identity), and Office is not supported for unattended server use. If you can, avoid COM and read/write .xlsx with the server‑safe Open XML SDK. Microsoft explicitly advises against server‑side Office automation and outlines the risks here: Considerations for server-side Automation of Office.

If you must automate, open defensively and suppress prompts that would hang the request. Also verify the web identity has read access to the workbook (and to temp folders) and use a UNC path for network files.

<%
Dim fso, ExcelApp, ExcelBook, BookPath
BookPath = "C:\filename.xls"  ' Prefer \\server\share\file.xls for shares

Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(BookPath) Then Response.End

On Error Resume Next
Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.DisplayAlerts = False
ExcelApp.AutomationSecurity = 3 ' msoAutomationSecurityForceDisable
Set ExcelBook = ExcelApp.Workbooks.Open(BookPath, 0, True) ' no link updates, read-only
If Err.Number <> 0 Then Response.Write "Open failed: 0x" & Hex(Err.Number)

' ...use ExcelBook...

If Not ExcelBook Is Nothing Then ExcelBook.Close False
If Not ExcelApp Is Nothing Then ExcelApp.Quit
Set ExcelBook = Nothing : Set ExcelApp = Nothing
%>

Parameters for Workbooks.Open and the AutomationSecurity constant are documented here: Workbooks.Open method and MsoAutomationSecurity enumeration. If failures persist, grant Launch/Activation to the web identity via DCOMCNFG as described in this Microsoft Q&A note: Excel Application missing in DCOMCNFG.

Is there any another solution for this error "Unable to get the Open property of the Workbooks class"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.