I am using the following code to output a report into Excel 2003.
The Excel Macro looks like this:
Everything works fine except that when access is re-opened, I receive a message box saying "Automation Error".
Can anyone please tell me why I am receiving this message?
Thanks
John
Code:
Dim oXL As Object, x
stDocName = "RptSignatureSheet"
Set oXL = CreateObject("Excel.Application")
DoCmd.OutputTo acOutputReport, stDocName, acFormatXLS, "c:\zzz\signaturedata.xls", True
With oXL.Application
.Visible = True
.Workbooks.Open Filename:=("c:\zzz\ExcelMacros.xls")
x = .Run("TrophySigSheet")
End With
Set oXL = Nothing
The Excel Macro looks like this:
Code:
Windows("signaturedata.xls").Activate
ActiveWorkbook.Save
ActiveWorkbook.Close
Workbooks.Open Filename:="c:\zzz\Trophy Sig Sheet.xls", UpdateLinks _
:=3
ActiveWorkbook.Save
Windows("ExcelMacros.xls").Close
Can anyone please tell me why I am receiving this message?
Thanks
John