To create a code-signing certificate, follow these steps:
From Programs menu, choose Microsoft Office -> Microsoft Office Tools -> Digital Certificate 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.