And another one... code to reset macro security level?

Johnny C

Well-known Member
Joined
Nov 7, 2006
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
I expect this won't be possible but it's worth an ask.

All my workbooks have macros, and I might be opening them at the rate of 1 per minute for a couple of days to run things. to stop Excel getting it's knickers in a twist I need to restart XL regularly.

I run a sort of network-based version, most of the code is on my PC but a lot of options are overlaid from the network when I start XL. Oneof which is Security level.

I can go into Tools>Options>Security>Macro security and reset it to Low each time but it's a hassle each time I open Excel and I'd rather put it into my personal.xls!ThisWorkbook tab as a piece of VBA.

Is this possible? I suspect not or rogue spreadsheets could in theory reset the level prior to another more malicious workbook being opened, but as I said it's worth an ask.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Your suspicion is correct. If you can change the macro security settings from within VBA, it would defeat the purpose.
 
Upvote 0
You can't automate security settings for the reasons you state yourself.

Curious as to how your security setting is reset on client machine via network, ie set to Low, close - reopen and it's Medium... how so ?
 
Upvote 0
Yes you can, with certain provisos (one of which is that I suspect it would be against the forum rules for me to tell you how!). But if your security is overlaid every time you start Excel, I don't see how it would help anyway?
 
Upvote 0
What about adding a digital signature to your code?

Might not need to change the security level at all...
 
Upvote 0
Rory, (y), I did prefix my original post with AFAIK but then took it out as I was sure you couldn't... and yes I'm 100% sure such dark arts are not allowed to be spoken of...

Still curious as to how the security setting is reset each time to a network/initial install setting...
 
Upvote 0
I would guess it's a Group Policy thing.
 
Upvote 0
I know not how they do it, the techy bods won't tell the likes of me for obvious reasons.

I work for a very large US financial corporation, they rewrite a lot of Windows things unfortunately. Unnfortunately as they haven't realised that MS have spent years writing Windows stuff and they still can't get it to work correctly all the time, and that a small bunch of propellerheads is unlikely to be able to successfully dissemble Windows and Office, add their own bits and when they put it back together it will all work. Perhaps they don't know about Humpty Dumpty.

I'm lucky in that I'm using a test rollout of the XL2003 implementation, in the standard XL2K one they have disabled the security tab altogether so I couldn't change security levels at all. Alas, that's what happens when you let people in IT who never use Excel dictate what bits of Excel you will and won't have. A few years ago the IT people put out a proposal that they would block access to VBA as part of the standard build. Mercifully someone Very High Up explained in simple terms to them that if they blocked people using macros in Excel the company would literally grind to a halt within a matter of hours. The proposal never reappeared so I suspect that the conversation was something along the lines of "If you ever even think of doing that again, you're fired"
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,993
Members
448,539
Latest member
alex78

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