MarkGallie
Registered User.
- Local time
- Today, 03:10
- Joined
- Apr 17, 2013
- Messages
- 13
I need to open an Excel Workbook from an Access Program and then Run a Macro from an Personal Macro Workbook. I can run the macro manually from the Workbook and I can also run a macro stored locally in the Workbook through Access. Here is the code I'm using:
Public Function TestExcelMacro()
Dim objXLApp As Object
Dim XLApp As Object
Set XLApp = CreateObject("Excel.Application")
With XLApp
.Application.Visible = True
.UserControl = True
.Workbooks.Open "\\DATA-WW\Users\markgallie\My Documents\HireNumbersCJ(11.09.13).xlsx", False
.Application.Run "PERSONAL.XLSB!SetUpPage"
End With
End Function
I have also tried using the Full path of the Personal Macro Workbook in the ".Application.Run" Function. Can anyone shed any light on where I'm going wrong?
Thanks
Mark
Public Function TestExcelMacro()
Dim objXLApp As Object
Dim XLApp As Object
Set XLApp = CreateObject("Excel.Application")
With XLApp
.Application.Visible = True
.UserControl = True
.Workbooks.Open "\\DATA-WW\Users\markgallie\My Documents\HireNumbersCJ(11.09.13).xlsx", False
.Application.Run "PERSONAL.XLSB!SetUpPage"
End With
End Function
I have also tried using the Full path of the Personal Macro Workbook in the ".Application.Run" Function. Can anyone shed any light on where I'm going wrong?
Thanks
Mark