Error Message : -2147023067 - Automation Error

  • Thread starter Thread starter Vensia
  • Start date Start date
V

Vensia

Dear all,

I use the below code to open Excel file. In several computers, I get error
message -2147023067 - Automation Error.
The status of Excel application is active. What causes the error ? Thanks.

Dim objXL As Object
Dim objActiveWkb As Object

On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
MsgBox "Run Microsoft Excel application.", vbInformation
Exit Sub
End If

objXL.Workbooks.Open FileName:=Me!txtFileName
If Err.Number <> 0 Then
MsgBox Err.Number & " - " & Err.Description
Exit Sub
End If


Regards,
Vensia
 
Several computers? Are they the same OS and build? Do they all have
Access / Excel installed? Do they run the same version? At what line
are you getting the error?
 
Back
Top