Open Excel from Access (1 Viewer)

rizabdullah

Registered User.
Local time
Today, 02:44
Joined
Mar 17, 2015
Messages
15
Hi Guys

I am trying to open .XLSM excel file from Access module but I am getting error message "run time error -2147417846 (8001010a) automation error the message filter indicated that the application is busy".
My code is:
Function runExcelMacro(wkbookPath, macroName)
Dim objXLApp As Object
Dim objXLBook As Object
Set objXLApp = CreateObject("Excel.Application")
Set objXLBook = objXLApp.Workbooks.Open("K:\default\Access Routine\Final Files\Miniroll - Copy.xlsm")
objXLApp.Application.Visible = True
End Function

Can someone please advise...

Many thanks
 

Ranman256

Well-known member
Local time
Yesterday, 21:44
Joined
Apr 9, 2015
Messages
4,339
Is EXCEL OBJECT LIBRARY in the VBE references?

Is K assigned as a drive letter?
You should always use UNC paths: \\server\folder\file.xls

but the rest looks correct.
 

rizabdullah

Registered User.
Local time
Today, 02:44
Joined
Mar 17, 2015
Messages
15
Many thanks for the response.
I have VB for application, MS Access 15.0 object library, MS DAO 3.6 object library, OLE Automation, MS VB basic for app extensibility 5.3, MS ActiveX data object 2.1 library & MS outlook 15.0 object library
 

Gasman

Enthusiastic Amateur
Local time
Today, 02:44
Joined
Sep 21, 2011
Messages
14,231
Why not Microsoft Excel xx.0 Object Library ?
 

rizabdullah

Registered User.
Local time
Today, 02:44
Joined
Mar 17, 2015
Messages
15
Just tried that, still same error. It's failing on:
Set objXLApp = CreateObject("Excel.Application")
 

Ranman256

Well-known member
Local time
Yesterday, 21:44
Joined
Apr 9, 2015
Messages
4,339
thats usually all it takes.
It could be the PC. I have seen failures on 1 PC , but not another.
Can you try it another PC?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:44
Joined
May 7, 2009
Messages
19,231
If the file is in use, it will not ipen. Add error handler on your code.
 

Gasman

Enthusiastic Amateur
Local time
Today, 02:44
Joined
Sep 21, 2011
Messages
14,231
I have the code below in one of my modules and that works fine?
Not sure what the difference would be, but worth trying?, if only to debug the problem.?

Code:
Set XLApp = New Excel.Application
 

rizabdullah

Registered User.
Local time
Today, 02:44
Joined
Mar 17, 2015
Messages
15
It works fine from another pc.

Many thanks for you assistance guys
 

Users who are viewing this thread

Top Bottom