Thursday, April 17, 2008

Creating Digital Signature for VBA Project (Outlook VBA / Excel VBA/ Word VBA)

How to digitally sign a VBA Project

To create a code-signing certificate, follow these steps:

From Programs menu, choose Microsoft Office -> Microsoft Office Tools -> Digital Certificate for VBA Projects


Navigate to the folder where your Office applications are installed, usually C:\Program
Files\Microsoft Office\Office12 for Office 2007 and run the Selfcert.exe program.


SelfCert.exe is provided with Office 2000 and later. If it is not installed on your system, run Office Setup and install Office Tools  Digital Signature for VBA Projects.

Type a name for your certificate - just use your own name or product name and click OK to create your personal code-signing certificate.


Now open the VBA project using Alt+F11 and select Tools ➪ Digital Signature
to open the dialog shown below. In this dialog, click the Choose button and select the
certificate and click OK twice to choose your certificate and
sign your code project with that certificate.

Save your VBA project; then exit and restart Application (Excel / Word / Outlook).
When you open your VBA project next time, you will be prompted to enable your macros in
the dialog shown below

You can use this dialog to trust your certificate by selecting the option to "Always trust macros from this publisher", which prevents this dialog from appearing again, or you can just enable the macros for that session.

Click the Trust All Documents from This Publisher button to trust your code-signing certificate
and add it to the trusted publishers list. If you open the Trust Center dialog shown
again and click the Trusted Publishers area, you will now see your code-signing certificate listed
as a trusted publisher.

The same certificate can be used for multiple projects.


  1. Michael12:06 AM

    Very helpful. Thank you.

  2. Anonymous4:13 PM

    what if you went through the steps listed and created a certificat. then wanted to export that certificate to another computer?
    the export seems straight forward enough, but i can't seem to find where to import it so that excel will allow you to use it to sign macros on the new computer...

  3. useful piece of information, hope to see some new articles about signing PDF's, thanks.

  4. Anonymous12:06 PM

    I found the pictures in this article very confusing. Are they randomly located in relation to the text?

  5. Anonymous8:37 AM

    How to renew a celf created digital certificate for vba code in multiple locations and users?

  6. Great post. I am glad to see your article here. Your content is really interesting when i read that. You have a good writing inside there. Am in Netherland and Thanks a lot for sharing.


Share on Facebook
Related Posts Plugin for WordPress, Blogger...
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.