The problem with custom macros and VBA projects is that Microsoft Office 2010’s security features tends to err on the side of caution, giving you a warning for every single macro you’ve created every time you boot up an Office application. It’ll say something like: “Microsoft Office has identified a potential security concern. Macros have been disabled. Macros might contain viruses or other security hazards. Do not enable this content unless you trust the source of this file.”
It’s a minor annoyance, but it’s a nuisance all the same. In order to get rid of those nagging warnings, you have to get your custom macros digitally signed. Here’s how:
Step One
Click Start and open the Microsoft Office 2010 folder. Within this folder, look for the Microsoft Office 2010 Tools folder. Expand it and click Digital Certificate for VBA Projects.
Step Two
Type a name for your self-signed certificate and click OK. It doesn’t matter what you name it. Afterwards, you’ll see a message saying the digital certificate was created successfully.
Note: Office will give you this long spiel about how self-signed certificates only work on your machine, because self-signed digital signatures could be forgeries, but that doesn’t matter, since you’re making this for your own projects. However, if you do plan on distributing your custom macros, you should look into getting an authenticated code signing certificate. The Create Digital Certificate program gives you a convenient link for commercial certificate authorities, if you’re interested in going that route.
Step Three
Launch Outlook 2010, or Word 2010 or whatever Microsoft Office 2010 application you have custom macros for. Click the Developer tab and choose Visual Basic.
Step Four
Open a VBA project and click Tools and choose Digital Signatures.
Step Five
In the Digital Signature window, Click Choose…
Step Six
Select the self-signed digital certificate you just created and click OK.
Step Seven
Save your VBA project.
Step Eight
Next time you launch your Office 2010 application, you’ll get a different message that says: “Warning: This publisher has not been authenticated and therefore could not be imitated. Do not trust these credentials.” The reason it’s saying this is because it’s self-signed—you can trust it because you’re the one who made it. Click Trust all documents from this publisher and you’ll be rid of those nagging warnings forever.
And that’s all there is to it. If you ever want to remove a certificate, you can do so by opening up Control Panel > Network and Internet > Internet Options and going to the Content tab.
Click the Publishers button under Certificates.
Here, you can remove certificates by selecting them and choosing remove. Following the above directions for creation of a self-signed certificate, everything goes fine until I try to assign the certificate to the project in the VBA editor. My certificate doesn’t appear in the Digital Signature window, when I click on Choose, no certificates are there to choose from. I’ve confirmed in internet options that the certificate exists. Any ideas? Thanks Thank you so much for this excellent tutorial. I’ve previously had only one foray into the world of VB, and it was unsuccessful. This time, by contrast, was an absolute breeze and it worked right first time. Excellent. It’s also my first experience of GroovyPost, which I found when searching for a solution to my “auto bcc in Outlook 2010” problem, but it certainly won’t be my last. Thanks again. Thanks. Superb. Really helpful – I’ve used this to auto BCC myself every time, along with your other post. I nearly ran aground, though, when the certificate wasn’t applied when I restarted Outlook. However, I worked out that it was because I had three windows open – mail, calendar and tasks. The way to solve it was to shut down two of those windows, apply the changes and save. I had to do it three times so each time a different one was left open – mail, then calendar, then tasks – and eventually it worked. It may have just worked first time if I closed the others and had only one open but I’ll never know. Anyway, thanks again. The only slight modification I needed to make was to get this to work was to go to my macro within Outlook and then click view certificate properties when choosing the macro then select Install certificate and save to Trusted Publishers before proceeding with Carl’s step 6 above. I have a set of documents with macros in them and I want to be able to just run a tool to add this Self-signed certificate to those documents. There are just too many to do this by hand. I have the same problem , I would like to sign mor than one hundred documents. Did you find a tool or a script to do that ? I will appreciate if you can help me :-) Thank you Regards, Sofiane I would like to sign many excel with my certificat. I have more than one hundred files and I don’t want to do that manually. Someone know if I can do that automatically ? Thank you for your help, Regards, I face a similar situation but with document content signature, not with VBA, can you help ? it is as follows: I received a word document signed by a self-signed certificates, and I have trusted that certificate so that it become valid in word. Later on how can i untrust that certificate ? Many Thanks Thank you. BTW: Office 2016 hides the Digital Certificate app in a new location: C:\Program Files\Microsoft Office\root\Office16\SELFCERT.EXE It works well though. Thank you very much. -e Comment Name * Email *
Δ Save my name and email and send me emails as new comments are made to this post.