VBE Security

G

Guest

In the user environment that I have, I would like to be able to
programmatically change the macro security settings to check the Trust access
to Visual Basic Project when I run one procedure, but then at the completion
of that procedure to return the setting back to not trust (I.e., check the
block and uncheck it.) I have thought of at least one way to identify which
menu item I need to worry about through the use of an ID number or searching
through the CommandBars data; however, I have not figured out how to 1,
activate the window, or 2 perform any kind of manipulations to identify the
current status of the check box. I do know that if in the running of my code
that an error occurs that I need to get the box checked, but if the error
does not occur then the box is already checked.

It's a little obscure, but I am using VBE code to present a portion of the
VBE code when an added menu option is selected. Any assistance would be
appreciated. My concern is that users are not likely to restore the setting
upon completion of the program on their own. I can give them a warning, both
when they try to run it, and then another before closing out Excel; however,
I do not expect that users will take the necessary actions and I do not wish
to be the cause of some other malicious issue, if I can programmatically
prevent it.
 
G

Guest

For the moment, and to meet my project deadline, I am using a text prompt to
inform users of the actions necessary to allow my feature to work if the
setting is not correct, with a warning that the setting must be undone. Then
after they see the section of code that I am displaying (whether I directed
them to apply the setting or not), I again show them the directions to undo
the previous actions. I can say that I have provided the necessary
disclaimer, however it is still not the method I prefer.
 

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