Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable Macros in workbook programmatically
Does anyone know how to programmatically disable macros as though the user
clicked the "Disable Macros" button on the security warning dialog? If so, could you please post example code. Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable Macros in workbook programmatically
You can not toggle the macro security settings programmatically in any way...
You however are the first person on the forum wanting to disable them... I think you should get a gold star for that. This question comes up all the time trying to enable macros. You could however write some code that validates the user with some kind of a login. Getting the password right would set a global boolean that is checked immediately prior to any code executing. No password... No execution... HTH "quartz" wrote: Does anyone know how to programmatically disable macros as though the user clicked the "Disable Macros" button on the security warning dialog? If so, could you please post example code. Thanks in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable Macros in workbook programmatically
Thanks again Jim.
Actually, my code is validating to a certain file location. I'm trapping if the file has been moved because then other programs won't function correctly. Have had a problem with people emailing the file itself rather than the link to the file. I guess I could have code to delete the code modules...but do you know whether the "Trust access to visual basic project" check box setting goes with the file or whether that is set on each user's machine? "Jim Thomlinson" wrote: You can not toggle the macro security settings programmatically in any way... You however are the first person on the forum wanting to disable them... I think you should get a gold star for that. This question comes up all the time trying to enable macros. You could however write some code that validates the user with some kind of a login. Getting the password right would set a global boolean that is checked immediately prior to any code executing. No password... No execution... HTH "quartz" wrote: Does anyone know how to programmatically disable macros as though the user clicked the "Disable Macros" button on the security warning dialog? If so, could you please post example code. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disable macros on a programmatically opening .xls file | Excel Discussion (Misc queries) | |||
Disable or remove macros for a workbook to be sent in email... | Excel Programming | |||
How do I turn off macros when programmatically opening a workbook. | Excel Programming | |||
Disable Macros when opening workbook | Excel Programming | |||
How to disable autoopen() programmatically | Excel Programming |