Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Disable Macro

I have a macro that prompts the user to make a new workbook on startup,
would it be possible to stop the macro using an if statement that says if
this book has any other filename other than the origanl =vbno ?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Disable Macro

I think what you want is quite straight-forward. In your existing macro you
need to add something like the following before it gets down to business...

if not activeworkbook.name = "blahblahblah.xls" then
exit sub
end if

where blahblahblah.xls is the only workbook where the macro isn't stopped.

"phuser" wrote:

I have a macro that prompts the user to make a new workbook on startup,
would it be possible to stop the macro using an if statement that says if
this book has any other filename other than the origanl =vbno ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Disable Macro

Sweet!! Thanks so much


"Sam Wilson" wrote in message
...
I think what you want is quite straight-forward. In your existing macro you
need to add something like the following before it gets down to
business...

if not activeworkbook.name = "blahblahblah.xls" then
exit sub
end if

where blahblahblah.xls is the only workbook where the macro isn't stopped.

"phuser" wrote:

I have a macro that prompts the user to make a new workbook on startup,
would it be possible to stop the macro using an if statement that says if
this book has any other filename other than the origanl =vbno ?





Reply
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
Disable running of SelectionChange macro when in another macro? Tonso Excel Discussion (Misc queries) 6 March 21st 10 06:50 PM
disable a macro badamsios Excel Programming 1 April 4th 07 04:50 PM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
Disable a Macro Dave[_54_] Excel Programming 3 December 16th 05 04:19 AM
Disable Macro at open by an external macro Ricardo[_2_] Excel Programming 0 November 10th 03 07:50 PM


All times are GMT +1. The time now is 07:54 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"