The code first.
Dim objXL As Object, x
On Error Resume Next
Set objXL = CreateObject("Excel.Application")
.Visible = True
x = .Run("AccountsViewEngine", 0)
Set objXL = Nothing
As you can see, I'm using CreateObject to
start an instance of Excel. You can however, use fIsAppRunning function to decide between
CreateObject or GetObject.
CreateObject by defaults starts a new
instance of the application in hidden mode. Hence you need to set the Application object
After opening the workbook in which the
macro is present, use the RunAutoMacros method if you have any AutoOpen macro that you
wish to run.
Note that in order for Access to recognize
xlAutoOpen constant, you need to reference Excel Object Library.
Then simply use the Application.Run method
to run any macros. Note that the syntax I've used is
Run(Macro, Arg1, Arg2, ...)
as the function AccountsViewEngine is
expecting a Boolean argument which the zero satisfies.