PDA

View Full Version : set the security level to "Medium" through vba code



krishna.a
10-25-2007, 11:27 PM
Is it possible to set the security level to "Medium" and to check the "Trusted Sources tab" and "Trust all installed add-ins and templates" through vba code.

Thanks in advance.

Brandtrock
10-26-2007, 01:03 AM
Excel's security is bad enough. If you could do all of that by code, it would be virtually non-existent. Think about it a minute.

Regards,

krishna.a
10-26-2007, 02:35 AM
I hope every thing we can try writing code...need some googling..

OTWarrior
10-26-2007, 06:38 AM
vba code will only run if the security is set to low, or medium (if it is an accepted source).

If the setting is high, then i doubt there is a way of changing it (after all, if you had your settings as high, and some code changed it to low, there could be serious implications)
Also, if the setting is low, why would you want to set it as medium?


What do you really want to do? if you want to make sure the user can use your macros, then make a certificate that they can accept.

krishna.a
10-26-2007, 07:16 AM
I have got a code which will check the references in the VBA Project Library.
to make the code run we have to check the Trust acces to Visual basic Project.
This i wants to take care in the code itself.

Thanks in advance.

OTWarrior
10-26-2007, 07:56 AM
would you kindly post the code you currently have?

lucas
10-26-2007, 08:25 AM
This thread can go no further. This is considered hacking and is against board policy. If you can control whether someone has macro's enabled then you can run potentially malicious code on thier machine without thier permission....

please read our FAQ
http://www.vbaexpress.com/forum/faq.php?faq=psting_faq_item#faq_hack_faq_item

lucas
10-26-2007, 02:29 PM
Thread Closed

I have closed this thread instead of deleting it so that visitors to our forum who search here for this type of assistance will find this thread hopefully and understand the site policy before they post a similar thread.