Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
Open Excel file from VB and open MACRO no1jimmyman Excel Discussion (Misc queries) 0 February 14th 11 10:10 PM
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Macro to call a file that has a auto open macro in the file itself [email protected] Excel Programming 1 August 5th 05 06:39 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


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