enable macro automatically when we open a workbook

S

sam

Is there a way to enable macro automatically? everytime I open a specific
workbook?

Thanks in advance
 
R

ryguy7272

Of course! Open 'ThisWorkbook' and pop your code in there. Someting like
this:
Private Sub Workbook_Open()
MsgBox "Hi, thanks for opening me", vbInformation, "Ozgrid.com"
End Sub

Set Macro security level to 'Low'.

See more details here:
http://www.ozgrid.com/VBA/auto-run-macros.htm

Remember, the enable macros issue is part of Excel's inbuilt security &
cannot be bypassed. Individual installations of Excel can alter the settings
so that macros are automatically accepted - this can be done by selecting
Tools|Macros|security & setting the option from High or Medium to Low -
but....it needs to be done for every potential user.... i.e. not a great
solution...


HTH,
Ryan---
 
G

Gord Dibben

For a specific workbook you would have to digitally sign that workbook.

If for use on your own computer only you can use the SelfCert tool that
comes with Office.

If for use on other computers you would have to purchase a digital
signature.

See help on digital certificates or digital ID


Gord Dibben MS Excel MVP
 

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