PC Review


Reply
Thread Tools Rate Thread

How to block all macro when a particular file is open

 
 
Dileep Chandran
Guest
Posts: n/a
 
      21st Dec 2006
Hello everybody,

Is there a way to block all the macros, when Test.xls is opened. I dont
want users to run macro in any excel file, with Test.xls kept open.

Any help is really appreciated. Thanks in advance !

-Dileep

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      21st Dec 2006
You could add this to the top of every macro that shouldn't be allowed:

dim Wkbk as workbook
set wkbk = nothing
on error resume next
set wkbk = workbooks("test.xls")
on error goto 0

if wkbk is nothing then
'ok
else
msgbox "Please close test.xls first"
exit sub
end if



Dileep Chandran wrote:
>
> Hello everybody,
>
> Is there a way to block all the macros, when Test.xls is opened. I dont
> want users to run macro in any excel file, with Test.xls kept open.
>
> Any help is really appreciated. Thanks in advance !
>
> -Dileep


--

Dave Peterson
 
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
Open & update another file (through macro) while running macro Nitesh Microsoft Excel Programming 1 22nd May 2010 04:40 AM
Block Saving of Open XML File Types =?Utf-8?B?Qmlnd29vZA==?= Microsoft Outlook Installation 1 28th Aug 2007 06:32 PM
Macro to open a file open dialog box C C Microsoft Excel Discussion 2 5th Aug 2006 04:26 AM
Open a file do a macro ( made) and open next succesive file =?Utf-8?B?U1ZUbWFuNzQ=?= Microsoft Excel Programming 5 21st Apr 2006 10:14 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save =?Utf-8?B?ZGVsZ2Fkb3MxMjk=?= Microsoft Excel Programming 0 10th Mar 2005 09:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:08 AM.