LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Stopping error messages from popping up - part 2

Ok, I got another one. I click on a button and it runs this code:

Private Sub cmdEnterScores_Click()
ChDir "C:\WINDOWS"
Workbooks.Open FileName:="C:\WINDOWS\datasheet2006.xls"
(more non-important code here)

If the datasheet2006.xls does not exist I get a VB error telling me so and
the script halts. How do I code it so that if the datasheet.xls does not
exist I can pop up my own msgbox instead of the vb script error box?

Thanks,
Phil
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stopping Auto calculation in Part of a Worksheet Mhukki Excel Worksheet Functions 1 April 30th 08 05:04 PM
Stopping "Query Refresh" messages fmistry Excel Discussion (Misc queries) 2 March 6th 07 03:38 PM
Stopping "Query Refresh" messages fmistry Excel Discussion (Misc queries) 0 February 27th 07 08:33 PM
Stopping windows installer from popping up all the time Steve Excel Discussion (Misc queries) 0 January 19th 06 12:22 PM
All macros failing part way through with different error messages magpie Excel Discussion (Misc queries) 2 March 24th 05 02:31 PM


All times are GMT +1. The time now is 06:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"