Disable Macros in workbook programmatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top