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!

"Error while running Macro" - Urgent

Status
Not open for further replies.

thanask

Technical User
Oct 27, 2002
21
Can anyone please help me. I am running the following macro and it throws the following error messgage.

Sub Main ()

Dim objImpApp as object
Dim objImpRep as object

On Error GoTo ErrorHandler

Set objImpApp = Createobject("CognosImpromptu.Application")

ObjImpApp.OpenCatalog "C:\Catalog.cat", "Creator"

Set objImpRep = objImpApp.OpenReport ("C:\Report.imr")
objImpRep.RetrieveAll
objImpApp.Quit

Set objImpRep = Nothing
Set objImpApp = Nothing

Final:

Exit Sub

ErrorHandler:

Resume Final

End Sub


Compiling SAMPLE.MAC
SAMPLE.MAC(27) W--2030: Label 'ErrorHandler' is missing
SAMPLE.MAC(27) W--2030: Label 'Final' is missing
2 Errors and 0 Warnings in SAMPLE.MAC

Thanks in advance,
Kumar
 
Kumar

I copied and pasted your macro and got the same. The solution is pretty simple:
You've got spaces in front of the two labels - remove them!

Happy New Year

Simon Rouse
 
Thanks for the help. Wish U the same.
I am still getting the same error.

Thanks,
Kumar

 
That's odd. Perhaps there are some invisible characters. Try deleting characters in front of the labels so that they move up to the previous line and then press [Return].

Failing that, delete the lines containing the labels and reenter them making sure that the label name starts at the beginning of the line and ends with the colons.

Simon Rouse
 
Thanks.. Got it. Some spaces before the label is creating the problem.

Thanks
Kumar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top