How do I enable a macro using vba?

davin2929

Board Regular
Joined
Oct 13, 2002
Messages
129
When I open the workbook with an Auto Run macro in it the first thing that pops up is the disable/enable macro alert. I would like to set the code in the Auto run macro to disable that alert so when I open the workbook the Macro runs without clicking disable or enable macros.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You can't.

Thinking about it logically, how can you set a macro up to enable macros? For the macro to work, macros would have to be enabled.

This is a security feature to protect people from malicious code.

This question has been discussed several times on this board before. The general consensus is that lowering your security to always enable macros is a bad idea. A slightly better idea is digital signatures, Corticus has a decent description here of how to use these:

http://216.92.17.166/board/viewtopic.php?topic=21566&forum=2

HTH
 
Upvote 0
I wondered about this too :)

Mark is correct though, it can't be done. However, if you have MS Office, install the vba self-cert 'add in' from MS tools option.

You can then create a digital certificate, which when attached to your vba code (in vb editor) will allow your project to bypass security/macro dialogue each time.

Lookup "certificates" in xl & vba help for more info
 
Upvote 0
On 2002-10-16 16:46, skadan wrote:
I wondered about this too :)

Mark is correct though, it can't be done. However, if you have MS Office, install the vba self-cert 'add in' from MS tools option.

You can then create a digital certificate, which when attached to your vba code (in vb editor) will allow your project to bypass security/macro dialogue each time.

Lookup "certificates" in xl & vba help for more info

..or just follow that link I posted and follow corticus' procedure.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top