R
Ralph
I have an Access module where I used the code below courtesy of "The Access
Web". It opens Excel OK, and brings up my file OK (I replaced the file
location below with my file address), but does not 'trigger' the Macro to
run. I replaced "AccountsViewEngine" with "Macro2" which is the name of my
Macro. I added "Debug.Print x" to the code and it shows -- Error 2015 when
ran. Also I do not have an automacro!
Any help would be greatly appreciated as usual -- Thanks!!!
'Code Courtesy of
'Dev Ashish
Sub sRunCARMa()
Dim objXL As Object, x
On Error Resume Next
Set objXL = CreateObject("Excel.Application")
With objXL.Application
.Visible = True
'Open the Workbook
.Workbooks.Open "D:\CARM\SYS\CARMaV5\CARMaV5a.XLS"
'Include CARMA in menu, run AutoOpen
.ActiveWorkbook.RunAutoMacros xlAutoOpen
x = .Run("AccountsViewEngine", 0)
Debug.Print x
End With
Set objXL = Nothing
End Sub
Web". It opens Excel OK, and brings up my file OK (I replaced the file
location below with my file address), but does not 'trigger' the Macro to
run. I replaced "AccountsViewEngine" with "Macro2" which is the name of my
Macro. I added "Debug.Print x" to the code and it shows -- Error 2015 when
ran. Also I do not have an automacro!
Any help would be greatly appreciated as usual -- Thanks!!!
'Code Courtesy of
'Dev Ashish
Sub sRunCARMa()
Dim objXL As Object, x
On Error Resume Next
Set objXL = CreateObject("Excel.Application")
With objXL.Application
.Visible = True
'Open the Workbook
.Workbooks.Open "D:\CARM\SYS\CARMaV5\CARMaV5a.XLS"
'Include CARMA in menu, run AutoOpen
.ActiveWorkbook.RunAutoMacros xlAutoOpen
x = .Run("AccountsViewEngine", 0)
Debug.Print x
End With
Set objXL = Nothing
End Sub