Digitally Signing a VBA Project
The macro virus situation is even worse if you want to distribute your VBA applications, because many people are loath to accept files that have macros. Even if your reputation is such that people won't worry about files that come from you, how can they be sure that the code they have really was created by you? The Visual Basic Editor enables you to use a certificate to digitally sign your projects. A certificate is your iron-clad guarantee that you created a project. You get a certificate from a certified signing authority, such as VeriSign (www.verisign.com) or Thawte (www.thawte.com).
To see more code signing options, you can also run a web search for "code signing vba."You can also check out the list of companies that are members of Microsoft's Root Certificate Program, found at the following URL: http://msdn.microsoft.com/library/en-us/dnsecure/html/rootcertprog.asp
What if you just want to sign your own projects? In that case, you don't need a third-party certificate. Instead, Office 2007 comes with a tool that enables you "self-certify"-create a personal digital certificate that you can apply to your own projects. Follow these steps:
- Choose Start, All Programs, Microsoft Office, Microsoft Office Tools, Digital Certificate for VBA Projects. The Create Digital Certificate dialog box appears.
- Use the Your Certificate's Name text box to type your name (or whatever name you want to use), and then click OK.
- When you see the SelfCert success dialog box, click OK.
When you have your certificate installed, follow these steps to digitally sign a project:
- In the Visual Basic Editor, use the Project pane to click any object in the project you want to sign.
- Choose Tools, Digital Signature. The Digital Signature dialog box appears.
- Click Choose to display the Select Certificate dialog box.
- Click the certificate and then click OK. You're returned to the Digital Signature dialog box.
- Click OK.