Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to block all macro when a particular file is open
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to block all macro when a particular file is open
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open Excel file from VB and open MACRO | Excel Discussion (Misc queries) | |||
2007 Macro to Open File, Delete Contents, Save New File | Excel Discussion (Misc queries) | |||
Open a file do a macro ( made) and open next succesive file | Excel Programming | |||
Macro to call a file that has a auto open macro in the file itself | Excel Programming | |||
Automate open file, update links, run macro, close and save file | Excel Programming |