FirstTimeMacroHELP
Technical User
Morning,
I am trying to automate a weekly report to save as an Excel file on Series 7 Version 4 but when I save it from the Macro it moves columns, merges data and generally changes things. If I run the same report manually and save it as .xls it seems fine, this is getting really irritating as I have to log on out of hours to run the report.
Coding as below
Dim ImpAppObject as Object
Dim ImpRepObject as Object
Dim XLSPubObject as Object
Sub Main()
Set ImpAppObject = CreateObject("Impromptu.Application")
ImpAppObject.OpenCatalog "\\csdpr15ap\codadir\Impromptu\codalive.cat", "All users"
Set ImpRepObject = ImpAppObject.OpenReport("\\csdpr15ap\codadir\Impromptu\Exchequer\ADR_Laser.imr","LASER|2014 / 05|C00000|C99999|*")
ImpRepObject.RetrieveAll
Set XLSPubObject = ImpRepObject.PublishExcel
XLSPubObject.Publish "\\cs\groups\public\EXTRA IMPROMPTU REPORTS\ADR_Laser.xls"
ImpRepObject.CloseReport
ImpAppObject.Quit
Set ImpRepObject = Nothing
Set ImpAppObject = Nothing
End Sub
Thanks
I am trying to automate a weekly report to save as an Excel file on Series 7 Version 4 but when I save it from the Macro it moves columns, merges data and generally changes things. If I run the same report manually and save it as .xls it seems fine, this is getting really irritating as I have to log on out of hours to run the report.
Coding as below
Dim ImpAppObject as Object
Dim ImpRepObject as Object
Dim XLSPubObject as Object
Sub Main()
Set ImpAppObject = CreateObject("Impromptu.Application")
ImpAppObject.OpenCatalog "\\csdpr15ap\codadir\Impromptu\codalive.cat", "All users"
Set ImpRepObject = ImpAppObject.OpenReport("\\csdpr15ap\codadir\Impromptu\Exchequer\ADR_Laser.imr","LASER|2014 / 05|C00000|C99999|*")
ImpRepObject.RetrieveAll
Set XLSPubObject = ImpRepObject.PublishExcel
XLSPubObject.Publish "\\cs\groups\public\EXTRA IMPROMPTU REPORTS\ADR_Laser.xls"
ImpRepObject.CloseReport
ImpAppObject.Quit
Set ImpRepObject = Nothing
Set ImpAppObject = Nothing
End Sub
Thanks