There is a pretty good tutorial on using error handlers in macros on Microsofts website. Check it out. If you are still having problems, just let us know!
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q213637
I *think* I understand that. Don't have the time now to try it, though (time to leave!:)
At any rate, that says that it is for Excel 2000. Currently, I'm running Excel 97. Think it would work for that too?
Top of Sub below Dim's if any!
On Error GoTo myErr
Your code here!
End
myErr:
End Sub
This format will exit the macro on any error. JSW
The reason for he runtime error is because you
have not assigned anything in the event that
the user presses Cancel. If the user presses
cancel the result returned is False. I'm guessing
that you have a string variable assigned something
like Filename = app.getopenfilename & ".xls"
hence the False.xls
try putting in something along the lines of
If filename = False then End or Exit Sub depending
on if the routine was called via another macro.
Ivan
Yes, works for Excel 97 too.