PC Review


Reply
Thread Tools Rate Thread

Disable Macro

 
 
phuser
Guest
Posts: n/a
 
      4th Oct 2007
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 With Quote
 
 
 
 
=?Utf-8?B?U2FtIFdpbHNvbg==?=
Guest
Posts: n/a
 
      4th Oct 2007
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 With Quote
 
phuser
Guest
Posts: n/a
 
      4th Oct 2007
Sweet!! Thanks so much


"Sam Wilson" <(E-Mail Removed)> wrote in message
news:9ACC180A-1EE7-439D-BC28-(E-Mail Removed)...
>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable running of SelectionChange macro when in another macro? Tonso Microsoft Excel Misc 6 21st Mar 2010 06:50 PM
disable user running macro from Tools > Macro Steve Simons Microsoft Excel Misc 4 28th Sep 2006 06:28 AM
how to disable a macro by calling it from another macro paritoshmehta Microsoft Excel Programming 5 6th May 2004 07:24 PM
How to disable a macro Jeff Smith Microsoft Excel Programming 2 29th Nov 2003 09:11 AM
Disable Macro at open by an external macro Ricardo Microsoft Excel Programming 0 10th Nov 2003 07:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:45 AM.