Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disabling macros with Shift+[OPEN]
Is there a way to prevent a user from disabling VBA macros
by holding SHIFT when clicking the OPEN button? I'm using Excel 2000. Thanks, Brian. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disabling macros with Shift+[OPEN]
I do it as follows:
Name a cell in worksheet "X" as (say) AutoOpenExecuted. Add a Workbook_Open procedure (you probably have one already) and, at the end of it, insert Sheets("X").Range("AutoOpenExecuted").Value = True Also add a Workbook_BeforeSave procedure and include in it: Sheets("X").Range("AutoOpenExecuted").value = False In a frequently-used procedure, such as one you call at the beginning of other procedures to perform housekeeping tasks, or the Class_Initialize procedure for a frequently- used class, insert: If Sheets("X").Range("AutOpenExecuted") = False then _ MsgBox "Don't hold shift key when opening workbook" Thisworkbook.Close SaveChanges:=False The trick is to find the right place (or places) to check if the cell is True or False. -----Original Message----- Is there a way to prevent a user from disabling VBA macros by holding SHIFT when clicking the OPEN button? I'm using Excel 2000. Thanks, Brian. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Does Disabling Macros affect Hyperlinks | Excel Discussion (Misc queries) | |||
Disabling macros | Excel Discussion (Misc queries) | |||
Prevent user from disabling macros | Excel Programming | |||
Enabling/Disabling Macros | Excel Programming | |||
Open Method disabling Macros | Excel Programming |