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: