View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
BEEJAY BEEJAY is offline
external usenet poster
 
Posts: 247
Default replace VBA run-time error message with custom message

Further:
The code that selects the files are as per this sample:
Sub BB_Chassis()
Workbooks.Open ("C:\Contracts\BB-Pup-Chassis-2006_R0C0.xls")
End Sub

I wondering if an If-Then_Else could somehow be used.
If Exits, then select/open Work Book
Else, Call Message
Something like that?



"BEEJAY" wrote:

Used J-Walks Menu maker to create menu of frequently used Spread-Sheets.
This add-in will be sent to all our salesmen.
The menu lists ALL of the available Sp.Sheets, BUT not every salesman gets
every Sp.Sheet.
When a non-existant Sp.Sheet is selected from menu, error message pops up:
"C:\ .................... (file Name), could not be found. Check spelling
...............

I'd like to NOT have this message come up, but replace it with a custom
message,
something like: The requested file is not on your available list. Please
select the correct template.
Therefo Can I deactivate/delete the VBA message? If yes, How?
How can I program in a message that tests for the requested Sp. Sheet, and
selects the Sp. Sheet, if exists, or else comes up with my custom message?
I hope this makes sense.
Help!!