I am trying to open an print a report from a macro, and the macro fails even while creating teh Report Object. Can someone pls look the code below and tell me what's worng?
thanks for the help!
btw, i am running Impromptu Ver7.2 on Win 2000.
Sub Main()
Dim objImpApp as Object
Dim objImpRep as Object
Dim strReportName As String
On error goto ErrRtn
Set objImpApp = CreateObject("CognosImpromptu.Application"
objImpApp.OpenCatalog "C:\temp\temp.cat", "User"
strReportName = "C:\temp\temp.imr"
Set objImpRep = objImpApp.OpenReport(strReportName)
strReportName = objImpRep.FullName
objImpRep.RetrieveAll
objImpRep.Print
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
exit sub
ErrRtn:
msgbox "Error occured at " & Erl & " Error is " & Err
Set ImpRep = Nothing
Set ImpApp = Nothing
exit sub
End Sub
thanks for the help!
btw, i am running Impromptu Ver7.2 on Win 2000.
Sub Main()
Dim objImpApp as Object
Dim objImpRep as Object
Dim strReportName As String
On error goto ErrRtn
Set objImpApp = CreateObject("CognosImpromptu.Application"
objImpApp.OpenCatalog "C:\temp\temp.cat", "User"
strReportName = "C:\temp\temp.imr"
Set objImpRep = objImpApp.OpenReport(strReportName)
strReportName = objImpRep.FullName
objImpRep.RetrieveAll
objImpRep.Print
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
exit sub
ErrRtn:
msgbox "Error occured at " & Erl & " Error is " & Err
Set ImpRep = Nothing
Set ImpApp = Nothing
exit sub
End Sub