Need Macro Help - to change Macro Security to Low

Seanzies

Board Regular
Joined
Nov 19, 2005
Messages
212
I have a spreadsheet with Macros in it. But in order for them to run your macro security level has to be set to low. Is there a way with Auto_Open, to change the macro security to low first and automatically and then then macros will load in the spreadsheet. I know that sometimes you need to open excel first, change the macro security, then open the spreadsheet with the macros. I am trying to save some steps for users because thousands of people will be using this and I don't want to get calls from them saying the macros are not working because they didn't read my instructions.
Can anyone help????
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
No this cannot be done. Macro security is there so malicious code cannot be run by unsuspecting users. If it could be changed with code then there would be no point in having security.
 
Upvote 0
If you use a launch program this can be done. You make a small exe they click on and it loads the spreadsheet for them. During the execution of the exe and before the launch you can change the macro secruity settings by editing the registry keys. Set it to low and the spread sheet opens fine and on workbook close re-edit the key to put it back to what it was. Ofcorse this is tricky becuase if your workbook crashes they have no secuirty until they open and close it again. You are also changing settings without asking the user which can be bad but it can deff be done.
 
Upvote 0
Yes, you could do that, but you would need to have a development platform (not excel) in which you could create an application to do it. But Id be very leary about developing an app that you are going to release to thousands of coworkers that modifies their registry. I suspect you could get into so heat with that.
 
Upvote 0
ADVERTISEMENT
Do you know anywhere where there is something like this out there that I could use. I would want to test it on mine first.
 
Upvote 0
Travis is correct like i stated it isnt not a safe or smart thing idea to play with their registry but it can be done. You would have to code the application yourself to meet your needs etc. The way I handle this is by placing a sheet at the start of my workbook and hide it on workbook open. If macros are enabled they wont see it if they are disbaled they will. The sheet simple gives instructions with pictures to help show them how to enable macros. I suggest this route.
 
Upvote 0
ADVERTISEMENT
How have you done that. I think that would be a good route to go and much safer.
I understand what I would need to do to make the instructions page, but how do you determine and know that the macros are disabled. I assumed that you used VB. Do you happen to have the code that you used and wouldn't mind sharing that?

Thanks in advance for all of your help!
 
Upvote 0
If macros are disabled then the auto open wont run and the sheet will be visible. If they are enable then the auto open will run and hide the sheet.

Something like this should work.

Code:
Private Sub Workbook_Open()
    Sheets("Macro_Security_Instructions").Visible = xlVeryHidden
End Sub
 
Upvote 0
Travis,
I tried that I created a sheet called Macro_Security_Instructions, did a Format, Sheet, Hide. Then to test, I set my Macro Security to High.
Went to Visual Basic Editor, inserted a module and pasted this code that you gave me.

Private Sub Workbook_Open()
Sheets("Macro_Security_Instructions").Visible = xlVeryHidden
End Sub

Then I saved changes, closed the workbook and reopened and the Macro Security box popped up stating that macros were disabled. Also the Macro_Security_Instructions sheet was not displayed. It was still hidden and the other sheets that should be displaying were visable.
Did I miss something?
 
Upvote 0
Seanzies

I think the idea is not to hide the sheet.

The code in the Open event will do that if macros are enabled.
 
Upvote 0

Forum statistics

Threads
1,196,053
Messages
6,013,118
Members
441,749
Latest member
batel19

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