PDA

Click to See Complete Forum and Search --> : How do I get the 'Enable Macros' command to automatically work?


jeff5240
Jul 17th, 2006, 12:38 PM
How do I get the Macros to enable upon opening the workbook instead of always having to "enable" them?

Static
Jul 17th, 2006, 12:50 PM
Tool Menu > Macros > Security set it to LOW.

But this can open you up to attacks.

jeff5240
Jul 17th, 2006, 12:56 PM
I did this and it still gives me the prompt box to enable macros....is there a code that can be used to stop the box from prompting and enable automatically?

Static
Jul 17th, 2006, 01:03 PM
???
It still prompts you?

are you sure you set it to low?

there is no way to automatically enable... that would be a security risk.

you can put an xls in the XLStart folder and that wokbk will run macros without being prompted... what is it you need to happen when it opens?

jeff5240
Jul 17th, 2006, 01:09 PM
The file has command buttons for people in my office to pick what they need to see or accomplish. The macros are nothing more than copying and pasting functions. I just know the people who will be using it will not understand or complain they have to "Enable" the macros before using the functions

RobDog888
Jul 17th, 2006, 01:14 PM
You need to set it to Low and close Excel. Then reopen the workbook and you should not get the prompt. Yes, its not possible to do via code as it defeats the purpose of having security.

Comintern
Jul 17th, 2006, 05:24 PM
You can always sign your code with a certificate, and have the users install the certificate on their machines (it’s basically just a matter of double-clicking it in explorer and hitting ‘OK’). Check out the tutorial here. (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_dsvba.asp)

RobDog888
Jul 17th, 2006, 05:32 PM
Yes and I have one too located here - http://vbforums.com/showthread.php?t=285212

But the problem with using SelfCert.exe is that it is machine dependant. If you distribute the private cert than it becomes invalid on another system as the validation is a hardware hash. so a different system will generate a different hash and not validate.

A public purchased cert may be required if your distributing it.

Comintern
Jul 17th, 2006, 05:35 PM
But the problem with using SelfCert.exe is that it is machine dependant. If you distribute the private cert than it becomes invalid on another system as the validation is a hardware hash. so a different system will generate a different hash and not validate.
Interesting. Was this a recent Office change? I do this all the time at work haven't had any problems (Office & Windows 2K).

RobDog888
Jul 17th, 2006, 05:41 PM
Im not sure if its only with Office 2003 and newer but I have had to trouble shoort this same situation with another member and I remember reading a footnote somewhere on MS stating so. It was stated that the selfcert.exe needed to be instaled on each station from the Office CD modify install and generate a cert on each.

It did seem odd but I'll look for it again.

Maybe it is just for being a fully trusted cert being installed in the trusted root authorites store or such.

RobDog888
Jul 17th, 2006, 06:01 PM
Note Digital signatures that are created with the SelfCert.exe program are for personal use only. They are not meant for commercial distribution of VBA macro solutions. The type of certificate that is generated does not verify your identity.

For public distribution, you will need to purchase a valid certificate from a Certification Authority (CA). The certificates generated in this tutorial are test certificates and should be used for testing purposes only. They should not be used to code sign files that will be publicly distributed. This is because since the certificates are not issued by a CA whose root certificate is already trusted on a user's machine, the test certificate will not validate correctly on the user's machine. Independent software vendors can obtain valid certificates from VeriSign, GTE, or other certification authorities to digitally sign code files that will be distributed to the public.Something along that quote shows that they are not distributable and why I suggested installing SelfCert.exe on each machine with Office.