How to force Excel to turn on macro when open?

hon

Board Regular
Joined
Oct 10, 2005
Messages
73
Just want to find out if it is possible to force Excel to turn on macro when open.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Here's one way. Actually, it's several ways, but you get the idea. I like the EnableMacros.zip method, myself.

Hope that helps!
 
Upvote 0
not quite what I wanted. The reason why I want this feature is I want to stop users from making coping of the master file stored in our internet portal. I have a before_save macro to disable some function rendering it useless. But this macro won't work if a user can turn off the macro and save a copy in their own drive.
 
Upvote 0
hon

This is no way to prevent a user from disabling macros, or a macro enabling macros. If this was possible then virus's could easily infect your system :wink:
 
Upvote 0
but is it possible to tell Excel not to load macro/VBA if macro is turned off so that if a user do try to save the file, it would be useless without the macro.
 
Upvote 0
You could disable Save and Save As for that file through VBA code. Perhaps include a macro (tied to a button) that uses an input box to ask for a password before you can save.
 
Upvote 0
Hi Tom, your solution from last night also depends on macro being turned on on open, right?
 
Upvote 0
If "turned on" to you means Enabled, then yes it does, which I said twice last night is not possible to control, and others have told you the same thing last night and now again here tonight:
Tom Urtis said:
Security (such as it is) is handled at the local (computer) level, and if someone wants to make a copy of the workbook they will, in Explorer or other ways that are easily available totally outside of the workbook author's control.
Tom Urtis said:
there are no guarantees against piracy, intranet or not, and especially not possible to control the macro security settings of one computer from another.
Nimrod said:
hon

This is no way to prevent a user from disabling macros, or a macro enabling macros. If this was possible then virus's could easily infect your system :wink:

Thne I gave you directions and code to take the macros out of a file and make a copy of that file so it has no code in it. That way you won't have to worry about th euser's security settings because the file you are sending them has no code, which you originally asked about.

Beyond that, maybe you need a platform other than Excel.
 
Upvote 0

Forum statistics

Threads
1,211,852
Messages
6,104,367
Members
447,902
Latest member
chriswebs23

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