Hi,
I am wanting to create a macro that open an impromptu report, runs it and then saves it as xls. I have managed to create the following....
Sub Main()
Dim objImpApp as Object
Dim objImpRep as Object
Dim strExcelFileName As String
Set objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.Visible True
Set objImpRep = objImpApp.OpenReport("N:\Cognos Development\Land Rover Ops\Impromptu\Land Rover UK Stock VIN V2 Limited Columns.imr")
strExcelFileName = Left$(objImpRep.FullName, Len(objImpRep.FullName) - 4)
objImpRep.ExportExcel strExcelFileName & ".xls"
'objImpRep.CloseReport
'objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub
However, this opens Impromptu and then requests the catalog logon details which I want to be able to pass thorugh in the macro so it can run overnight. Can anyone tell me how to do this?
Thanks.
A.
I am wanting to create a macro that open an impromptu report, runs it and then saves it as xls. I have managed to create the following....
Sub Main()
Dim objImpApp as Object
Dim objImpRep as Object
Dim strExcelFileName As String
Set objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.Visible True
Set objImpRep = objImpApp.OpenReport("N:\Cognos Development\Land Rover Ops\Impromptu\Land Rover UK Stock VIN V2 Limited Columns.imr")
strExcelFileName = Left$(objImpRep.FullName, Len(objImpRep.FullName) - 4)
objImpRep.ExportExcel strExcelFileName & ".xls"
'objImpRep.CloseReport
'objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub
However, this opens Impromptu and then requests the catalog logon details which I want to be able to pass thorugh in the macro so it can run overnight. Can anyone tell me how to do this?
Thanks.
A.