Enable Macros by Code

A

aftamath77

Is there code I can put in visual basic that will enable all macros when the
workbook opens, so there is no need to click the options for enable macros.

I know how to enable macros in the Trust Center, I would like to enable by
code.
 
B

Barb Reinhardt

Try putting this BEFORE you open up your macro.

Application.AutomationSecurity = msoAutomationSecurityLow

If you want the user to later be requested to enable macros, change it back
to

Application.AutomationSecurity = msoAutomationSecurityByUI
 
R

Richard Schollar

Hi

There is no way to include such code within a workbook to enable the macros
within that same workbook - the enable/disbale macros prompt is for security
purposes, so it wouldn't be much use if you could simply override it.

Richard
 
M

Mike H

Hi,

No, you can't enable macros by code. If security is set to medium or higher
then it's a user choice whether macros are enabled or not.

Mike
 
J

John C

Create a Digital Signature.
Add Digital Signature to your macros.
Add Digital Signature to 'Trusted Sources' to the user's computers.
 

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

Top