Questions And Answers

More Tutorials

VBA Macro security and signing of VBA projects modules

Create a valid digital self-signed certificate SELFCERT.EXE

To run macros and maintain the security Office applications provide against malicious code, it is necessary to digitally sign the VBAProject.OTM from the VBA editor > Tools > Digital Signature.

Office comes with a utility to create a self-signed digital certificate that you can employ on the PC to sign your

This utility SELFCERT.EXE is in the Office program folder,

Click on Digital Certificate for VBA Projects to open the certificate wizard.

In the dialog enter a suitable name for the certificate and click OK.

If all goes well you will see a confirmation:

You can now close the SELFCERT wizard and turn your attention to the certificate you have created.

If you try to employ the certificate you have just created and you check its properties

You will see that the certificate is not trusted and the reason is indicated in the dialog.

The certificate has been created in the Current User > Personal > Certificates store. It needs to go in Local Computer > Trusted Root Certificate Authorities > Certificates store, so you need to export from the former and import to the latter.

Pressing the Windows Key+R which will open the 'Run' Window. then Enter 'mmc' in the window as shown below and click 'OK '.

From the File menu, select Add/Remove Snap-in... Then from the ensuing dialog, double click Certificates and then click OK

Expand the dropdown in the left window for Certificates - Current User' and select certificates as shown below. The center panel will then show the certificates in that location, which will include the certificate you created earlier:


In this page (written and validated by ) you learned about VBA Macro security and signing of VBA projects modules . What's Next? If you are interested in completing VBA tutorial, your next topic will be learning about: VBA Run Time Errors.

Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue:

Share On:

Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using, you agree to have read and accepted our terms of use, cookies and privacy policy.