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: 201
Default Prevent Error Message

I have code written (see below) that makes sure if a workbook (TMR.xls)
is called something else or is not located in the right folder (TMR folder),
then the user cannot open it. It works fine if the workbook has been located
in
another folder. But, if it has the wrong name and is in the TMR folder, a
Visual Basic Error message appears saying it can't locate the workbook, AND
THEN OPENS IT !!!! The visual basic error is preventing the rest of the code,
which would close the workbook. any suggestions how to get around this? Your
help will be appreciated.
code=
If ActiveWorkbook.FullName = "C:\TMR\TMR.xls" Then
Sheets("MENU").Select
Else
Sheets("End").Select
Application.ActiveWorkbook.Save
Application.Quit

Please note that simply entering 'On Error Resume Next' in the code is
not making any difference. I need to prevent the Error dialogue kicking in.

Your help is much needed and appreciated




Expand AllCollapse All
--
phil in da uk
 
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
prevent message Jack Sons Excel Discussion (Misc queries) 2 February 22nd 09 04:57 PM
how to prevent zero error message for logarithmic plots jlrosner Charts and Charting in Excel 2 February 18th 09 08:41 PM
How to write a formula that will prevent appearance ERROR MESSAGE Huriiii Excel Worksheet Functions 1 June 22nd 05 12:45 AM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


All times are GMT +1. The time now is 06:17 PM.

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

About Us

"It's about Microsoft Excel"