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

Johnny C

Well-known Member
Joined
Nov 7, 2006
Messages
1,003
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.
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

TinaP

Well-known Member
Joined
Jan 26, 2005
Messages
523
Your suspicion is correct. If you can change the macro security settings from within VBA, it would defeat the purpose.
 

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,123
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 ?
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,104
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
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?
 

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
7,994

ADVERTISEMENT

What about adding a digital signature to your code?

Might not need to change the security level at all...
 

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,123
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...
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,104
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
I would guess it's a Group Policy thing.
 

Johnny C

Well-known Member
Joined
Nov 7, 2006
Messages
1,003
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"
 

Watch MrExcel Video

Forum statistics

Threads
1,122,867
Messages
5,598,542
Members
414,245
Latest member
allyciv

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
Top