?
Solved

Set macro security level to 'low level' on opening of a certain workbook.

Posted on 2010-11-09
7
Medium Priority
?
463 Views
Last Modified: 2012-05-10
Dear Experts:

On opening of a certain workbook, I would like to get the macro security level set to 'low level' (enable all macros) automatically (by VBA), regardless of the fact that it may have been set to this low level before.

How is this achieved?

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
0
Comment
Question by:AndreasHermle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 50

Assisted Solution

by:Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 336 total points
ID: 34097559
Hello Andreas,

by definition, macros can not set the security level of the application. That would defy the purpose of the security level in the first place, since it would be possible to write malicious code that simply sets the security level to low and then proceeds to run the macro.

So, the user needs to manually set the security level, then open the file they want to run.

cheers, teylyn
0
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 732 total points
ID: 34097574
AndreasHermle,You can't.  Think about it: if you could toggle this programmatically, then there would be no point to even having that setting.You need to either have macro security set to low via Group Policy (bad idea), or look into digitally signing the code.Patrick
0
 
LVL 50

Assisted Solution

by:Dave Brett
Dave Brett earned 600 total points
ID: 34097767
vbscript offers an external workaround that

1) Would set the security to the required level in the registry
2) Then automatically open the file

We can progress this if you wish

Dave
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 732 total points
ID: 34097832
Dave,I am aware of the Registry hack, but I avoid using it.  Some questions:1) If users are blocked by GPO from editing the Registry, will that block the script?2) Will that script leave Low as the new setting going forward, then (unless there is already some GPO that would reset the setting in the next Windows session or something like that)?Patrick
0
 
LVL 50

Assisted Solution

by:Dave Brett
Dave Brett earned 600 total points
ID: 34097862
Patrick

> 1) If users are blocked by GPO from editing the Registry, will that  block the script?

I think so - I have never been able to test this as I dont have that GPO in place

> 2) Will that script leave Low as the new setting going forward

I would store the current setting then reset it.
or
Run the macros from within the script rather than the workbook - which on second thought would avoid fiddling with the VBA macro settings at all (as long as the GPO allowed scripts)

Cheers

Dave


0
 
LVL 23

Assisted Solution

by:Michael Fowler
Michael Fowler earned 332 total points
ID: 34098775
You could always place the file in a trusted location
http://technet.microsoft.com/en-us/library/cc261678%28office.12%29.aspx
0
 

Author Comment

by:AndreasHermle
ID: 34119174
Dear all,

thank you very much for your great support. Every comment is useful, therefore I will try and distribute the points equally.

Brettdj: thank you very much for your prepardness to progress the VB script version if I wish. Since this macro would be run in a company environment I would have to involve other guys to allow Registry editing. Actually, I do not want that. So, I guess, I will rather look into digitally sign the code.

Thank you again for your great support.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question