I've written the following macro (I've only included a small section) and am having a problem with the second prompt, Year Selector. The macro works fine with a single prompt, the Month Selector. But when I modified the Report to include Year as a prompt, that's when the problem began. How do I get the macro to work. It stops and is waiting for the OK button to be hit.
Thanks,
Joe
Sub Main()
Dim x
Dim msgtext
msgtext="Enter a month number (1-12):"
x = InputBox$(msgtext, "Month Selector",1)
Dim y
Dim msgtexts
msgtexts="Enter Year (ex. 2006):"
y = InputBox$(msgtexts, "Year Selector",2006)
Dim objImpApp As object
Dim objImpRep As Object
Set objImpApp = GetObject("CognosImpromptu.Application")
objImpApp.Visible True
objImpApp.OpenCatalog _
"s:\imp71_reporting_tools\BI04\Imp71_User\CATALOGS\Costpoint Catalogs\General Ledger.cat","Plan","hire1cop",,,1
rem ***This is the beginning of the macro. Reports are generated first for the Green Book. Then for the Lab directors.***
Set objImpRep = _
objImpApp.OpenReport("s:\imp71_reporting_tools\joe's reports\Foss\" & _
"Report_01.imr",+x,+y)
objImpRep.RetrieveAll
objImpRep.Print
objImpRep.CloseReport
Thanks,
Joe
Sub Main()
Dim x
Dim msgtext
msgtext="Enter a month number (1-12):"
x = InputBox$(msgtext, "Month Selector",1)
Dim y
Dim msgtexts
msgtexts="Enter Year (ex. 2006):"
y = InputBox$(msgtexts, "Year Selector",2006)
Dim objImpApp As object
Dim objImpRep As Object
Set objImpApp = GetObject("CognosImpromptu.Application")
objImpApp.Visible True
objImpApp.OpenCatalog _
"s:\imp71_reporting_tools\BI04\Imp71_User\CATALOGS\Costpoint Catalogs\General Ledger.cat","Plan","hire1cop",,,1
rem ***This is the beginning of the macro. Reports are generated first for the Green Book. Then for the Lab directors.***
Set objImpRep = _
objImpApp.OpenReport("s:\imp71_reporting_tools\joe's reports\Foss\" & _
"Report_01.imr",+x,+y)
objImpRep.RetrieveAll
objImpRep.Print
objImpRep.CloseReport