View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default 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.