Everyone,
Currently I am attempting to open a designated excel workbook, execute a macro contained in that workbook, then save and close the workbook via VBA in Access. This is the code I currently have:
Public Sub RunExcel()
Dim objExcel As New Excel.Application
Dim objExcelDoc As Object
Set objExcel = New Excel.Application
Set objExcelDoc = objExcel.Workbooks.Open("WorkbookX"
objExcel.Visible = True
With objExcel
.Run ("MacroX"
End With
objExcel.ActiveWorkbook.Close savechanges:=True
objExcel.Quit
End Sub
When I attempt to call this code in an access macro, this error appears:
"The expression you entered contains a function name that Microsoft Access can't find"
I would appreciate any suggestions / assistance.
kevin v.
Currently I am attempting to open a designated excel workbook, execute a macro contained in that workbook, then save and close the workbook via VBA in Access. This is the code I currently have:
Public Sub RunExcel()
Dim objExcel As New Excel.Application
Dim objExcelDoc As Object
Set objExcel = New Excel.Application
Set objExcelDoc = objExcel.Workbooks.Open("WorkbookX"
objExcel.Visible = True
With objExcel
.Run ("MacroX"
End With
objExcel.ActiveWorkbook.Close savechanges:=True
objExcel.Quit
End Sub
When I attempt to call this code in an access macro, this error appears:
"The expression you entered contains a function name that Microsoft Access can't find"
I would appreciate any suggestions / assistance.
kevin v.