I'm new to macros in Cognos but am trying to create a macro that will run an Impromptu Report in Scheduler unattended. The part I'm having problems getting past is the Progress database logon screen. We are not using logon names and passwords for Progress so normally, when this prompt displays in Impromptu, I would simply ENTER through it to connect to the DB. When I try to run the macro in Scheduler, the procedure will sit at the logon for Progress until I press ENTER. I've read through several threads that have talked about this issue but am still not having any success. A copy of my macro is below that includes the syntax suggested in a thread, but I'm still being prompted for a database logon and password.
Can anyone offer assistance on how I can make this macro run totally unattended.
Thanks!
Sub Main
' ******************* Declare Variables ************************
'Dimension variables needed by the script
Dim ImpApp as object 'references the Impromptu application object
Dim ImpCat as object 'references the Catalog object
Dim ImpRep as object 'references the Report object
Dim User As Object 'references the User object
' ******************* Begin Execution ************************
On Error Resume Next
'First instantiate the application
Set ImpApp = CreateObject("Impromptu.Application")
ImpRep.ExportExcelWithFormat "O:\SytePwr\melTest.xls"
'Set to 1 for the application to be visible
ImpApp.Visible 1
'Open the correct catalog for the report
ImpApp.OpenCatalog "O:\SytePwr\Catalogs\fs-plus.cat","Creator",,,,1
'Open the actual report
Set ImpRep = ImpApp.OpenReport ("O:\Sytepwr\Reports\IT\Mods\Daily Customer Service Reports\Sales - SROs with Missing Jobs.imr")
'Retrieve all data for the report
ImpRep.RetrieveAll
'Print the report
ImpRep.Print
'Close the report
ImpRep.CloseReport
'Close the catalog
ImpApp.CloseCatalog
'Quit the application
ImpApp.Quit
'Release the application memory
Set ImpApp = Nothing
End Sub
Can anyone offer assistance on how I can make this macro run totally unattended.
Thanks!
Sub Main
' ******************* Declare Variables ************************
'Dimension variables needed by the script
Dim ImpApp as object 'references the Impromptu application object
Dim ImpCat as object 'references the Catalog object
Dim ImpRep as object 'references the Report object
Dim User As Object 'references the User object
' ******************* Begin Execution ************************
On Error Resume Next
'First instantiate the application
Set ImpApp = CreateObject("Impromptu.Application")
ImpRep.ExportExcelWithFormat "O:\SytePwr\melTest.xls"
'Set to 1 for the application to be visible
ImpApp.Visible 1
'Open the correct catalog for the report
ImpApp.OpenCatalog "O:\SytePwr\Catalogs\fs-plus.cat","Creator",,,,1
'Open the actual report
Set ImpRep = ImpApp.OpenReport ("O:\Sytepwr\Reports\IT\Mods\Daily Customer Service Reports\Sales - SROs with Missing Jobs.imr")
'Retrieve all data for the report
ImpRep.RetrieveAll
'Print the report
ImpRep.Print
'Close the report
ImpRep.CloseReport
'Close the catalog
ImpApp.CloseCatalog
'Quit the application
ImpApp.Quit
'Release the application memory
Set ImpApp = Nothing
End Sub