Set Menu options

S

Stephen sjw_ost

Hello again. I hope someone can help me with this question.
I am trying to use code to set the macro security on my databases to low
when the database is opened. Obviously, I will reverse this when the database
is closed.
I have tried using this code in the open event of my start up form;

CommandBars("Menu Bar")._
Controls("Tools")._
Controls("Macro")._
Controls("Security...")._
accDoDefaultAction

This code will open the macro security window but I have not been able to
figure out how to set the option to the low setting then click OK.
Can this code be used to perform this function?
Or, is there any code available to set the macro security?

I want to make this setting automatic so my users, or I, will not have to
make this change everytime they, or I, sit at a new desk and open one of my
databases
..
Thanks in advance for any help on this question.
 
J

John W. Vinson

Can this code be used to perform this function?
Or, is there any code available to set the macro security?

If there were then macro security would be absolutely useless, since it could
not be set in a way that would keep that setting.

No.
 
J

Jack Leach

I've often wondered if there's a way to publish your project under XYZ and
set the client computers to accept macros from publisher XYZ.

I've never really dealt with this type of stuff, but it would seem a good
way to retain security on untrusted publishers, but not have to go through
the security screens when using our own applications.

Does anyone know if this is possible?

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
S

Stephen sjw_ost

Thank you Jack. You and I are thinking on the same level. I don't want to to
set the macro security to low for every single macro or piece of code in
every DB or spreadsheet. I only want it set to low on the application
macro/code that I know are trustworthy, like my own for my company.
In the interim, seeing as how the code I submitted does bring up the macro
security window, I can at least give my users the option to change it on the
DB start up.

If we can't change the setting using code, can we DETECT what the setting is
currently set to?

If this can be done, then I can set up an IF/THEN statement that would be
something like;

If MacroSecurity = LOW Then
Normal use
Else
yes/no msgbox "To use this DB you must set your security to low" include
explaination and disclaimers in the msgbox.
User answers YES -
CommandBars("Menu Bar")._
Controls("Tools")._
Controls("Macro")._
Controls("Security...")._
accDoDefaultAction
User answers NO - Docmd.Quit
End If

Just a thought...

Anyway,
If this option is truly not currently available, then does anyone know how
this can be submitted and/or suggested to microsoft to be available in a
future version, update or patch for visual basic?

Maybe a simple patch to be able to assign the macro security to publisher
XYZ like Jack mentioned.

The responsible user would initially accept or decline the publishers
security setting. If they decline then the application would close, no harm
no foul. But if the responsible user accepts, then the application would be
made available from that point on and the user would not need to make
security changes for that DB to be able to use it in it's full capacity.

Just another thought...

The big question is still: If we can't change the macro security setting
using code, can we DETECT what the setting is currently set to?

Thanks for the advice, suggestions and help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top