Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Prompt Problem

Status
Not open for further replies.

1hrllabs

Technical User
Feb 21, 2005
19
US
I've written the following macro. The problem is that the report doesn't run. It hangs at the prompt and I have to manually hit "OK" for the report to run and complete the execution of the macro. What am I missing? Thanks.



Sub Main()
Dim objImpApp As object
Dim objImpRep As Object
Set objImpApp = GetObject("CognosImpromptu.Application")
objImpApp.Visible True
Set objImpRep = _
objImpApp.OpenReport("s:\imp71_reporting_tools\joe's reports\green book\" & _
"03-ORG Calendarized GB.imr","30.2|2")

objImpRep.Print 1

Set objImpApp = Nothing
Set objImpRep = Nothing

End Sub
 
1HRlabs:
I changed your getObject to CreateObject
and addedd open catalog it worked fine for me hope it works for you
Sub Main()
Dim objImpApp As object
Dim objImpRep As Object
Set objImpApp = _
CreateObject("CognosImpromptu.Application")
objImpApp.Visible True
objImpApp.OpenCatalog "C:\Cognos\Catalogs\Test_Catalog_1.cat", "Creator"
Set objImpRep = _
objImpApp.OpenReport("s:\imp71_reporting_tools\joe's reports\green book\" & _
"03-ORG Calendarized GB.imr","30.2|2")
objImpRep.RetrieveAll
objImpRep.Print 1

objImpRep.CloseReport
objImpApp.Quit
Set objImpApp = Nothing
Set objImpRep = Nothing

End Sub


John Organ
MIS
 
John,
Report still waiting for the "OK" to be hit or hitting the enter key.
Maybe it's something in the report filter or report prompt?
Jo
 
Thanks,my original works. I have more than the two prompts in the report and didn't realize that was causing the report to hang. I eliminated the other two prompts and voila, it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top