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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there any way to close impromtu when it encounters errors.

Status
Not open for further replies.

ccoughlan

Programmer
Feb 20, 2006
12
US
We currently run all our reports from macro files that are executed from windows scheduler. A problem we sometimes run into is that a report will run and encounter an error (possibly that the database is not available). What this does is hang the impromptu session until the message is acknowledged. This in turn hangs up other reports. This can be a pain since we run some of these reports off-hours and don't want to be going into the report server at 3:00 AM just to click through an error message. Is there any way to set up the macro so that if a report encounters an error, the impromptu session gets closed?
 
You should be able to catch the error number and to perform some others tasks when you encounter it, like exit the macro.


Sub main
Dim msgtext, userfile
On Error GoTo Debugger
.....
.....
.....
.....
Debugger:
msgtext="Error number " & Err & occurred at line:" & Erl
MsgBox msgtext
Resume done

End Sub
 
Unfortunately 'On Error' doesn't trap some of the Impromptu errors - I have a similar problem in OOH access when the backup decides to stall or the DB refuses to come back at the appointed hour.

If only the OLE implementation of Impromptu in CognosScript supported a ".DisplayAlerts = False" statement (as can be used with Excel), this problem could be overcome, this analyst would have a lighter spring to his step and the world would be a cheerier place....

soi la, soi carré
 
I think that is what I'm running into. I added the error trap logic to my macro and ran the macro. The report still hung up when it encountered an error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top