Page 7 of 10PREVNEXT

Audio course: Sign your own macros for stronger security

Tools menu in the Visual Basic Editor; clicking Choose in the Digital Signature dialog box; Select Certificate dialog box

Fig. 1  On the Tools menu, click Digital Signature, and then click Choose in the Digital Signature dialog box.
Fig. 2  In the Select Certificate dialog box, select the certificate that you want to sign the macro with.

Most of the effort in setting up a self-signed certificate is in installing the SelfCert.exe file and creating the certificate. Once you have a certificate, actually signing a macro is a matter of seconds.

In the Visual Basic Editor, with your macro open, click Digital Signature on the Tools menu, and then click the Choose button. If you have more than one digital certificate installed on your computer, you'll see them all listed. Select the appropriate certificate and click OK. Then save your newly signed macro. Signing one macro in a file is a bit of a misnomer because actually you sign all the macros in a file at the same time.

Self-signed certificates are just like authenticated ones in this respect: If someone who doesn't have the private key changes the code in the signed macro, it will immediately lose its signature.

Page 7 of 10PREVNEXT