Skip to content

Home Search Site Map Contact Us
You are here: Home Blog Howtos Signing Your Own Macros with SelfCert.exe
Signing Your Own Macros with SelfCert.exe Print
Sunday, 04 March 2007 16:41

SelfCert.exeIf you create a macro for any of the Microsoft Office applications (Word, Excel, Outlook, etc) and you are running Office with the default security settings, you will be unable to run your own macro. One option would be 'Enable all macros', but this setting could also allow potentially dangerous macros to run on your system as well. A better option would be to sign your own macro with SelfCert.exe.

Locate and Run SELFCERT.EXE

The default location for SelfCert.exe is C:\Program Files\Microsoft Office\Office <version number>. To run SelfCert for Office 2007 you would go to Start -> Run and then type:

C:\Program Files\Microsoft Office\Office12\SELFCERT.EXE

Create Digital Certificate

Your certifcate's name could be anything including your company name or your username. I'll use Mars.

Signing Your Code

Back in the VBA editor (ALT+F11) where you created the macro choose Tools > Digital Signature.

Digital Segnature

Click Choose... and choose your certificate name.

Select Certificate

Select the signature you create and then click OK.

Select Certificate

Running the Signed Macro for the First Time

The first time you run the macro, you will be presented with something like this. You can click Show Signature Details first to confirm the signature is the one you just created and then click Trust all documents from this publisher.

Security Warning



Bookmark and Share

Comments (1)

Subscribe to this comment's feed
what is the location of the saved certification? because i will install all our servers so i can't find the created certification?
azirila , August 10, 2012

Write comment

narrow screen wide screen Increase font size Decrease font size Default font size