View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Runtime error 1004

dim FName as variant
FName = application.getopenfilename
if fname = false then
msgbox "try later"
exit sub
end if



StephanieH wrote:

I have an interface that opens certain files based on criteria supplied by
the user. If the user starts the process then cancels out because they've
changed their mind of opening a file, they get a Runtime error 1004.

I'd like to suppress the runtime message and replace it with something along
the lines of
If Fname = Empty then
Msgbox ("You've chosen to not open a file at this time")
or something.

I just don't want it to look like the link isn't working correctly when the
user opts out. How can I suppress this error message specifically?


--

Dave Peterson