[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2010-11-09
7
Medium Priority
?
466 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

650 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