Enable Macros with a Macro!

M

Mark

What code do I need to ensure that when I open a spreadsheet macros are
automatically enabled in security rather than the programme giving the
option via the security tab?

I suppose it can't be done otherwise it could be exploited maliciously?

Mark
 
G

Guest

I don't think that you can enable macros with a macro.

How would the enabler every get executed??

Here is something to investigate:

Operating systems like Win XP allow more than one "user account" to be
created. Is it possible to create a dummy account for yourself that would
default to a medium or low security level and leave your regular account with
better protection?? I don't know.
 
P

Pete_UK

That is correct. What some people do is to have an on-close macro
which hides all the sheets and reveals another sheet which says " ...
you must enable macros to use this file ..." and saves the file.
Another on-open macro hides this warning sheet and reveals the other
sheets, as well as calling your controlling macro.

Hence, if a User does not accept macros when opening the file, all
that will be seen is the warning sheet.

This link shows how you can do this:

http://www.danielklann.com/excel/force_macros_to_be_enabled.htm

Hope this helps.

Pete
 
D

Dave Peterson

Another way to accomplish this is to give the real workbook a password to open.

Then give the users a secondary workbook that opens that workbook (supplying the
password) and then closes itself.

If the user doesn't allow macros to run on this "helper" workbook, then the
other workbook is not opened.

If the user allows macros on the helper workbook, then the other workbook will
be opened with macros enabled.
 

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