Hi All,
New to VBA and managed to get this far with some code...
It used to work perfectly, open the xls and then run the macro inside the xls, save it and close it however I now get this error.
Can anybody help?
New to VBA and managed to get this far with some code...
Code:
Option Compare Database
Public Sub RunExcelMacro()
Dim wb1 As Object
Set wb1 = CreateObject("Excel.Application")
With wb1
.Workbooks.Open ("XLS name")
.Visible = True
.DoCmd.RunMacro (refreshallconnections)
.activeworkbook.Save
.activeworkbook.Close (True)
End With
Set wb1 = Nothing
End Sub
It used to work perfectly, open the xls and then run the macro inside the xls, save it and close it however I now get this error.
Can anybody help?