|Signing Your Own Macros with SelfCert.exe|
|Sunday, 04 March 2007 16:41|
If 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
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.
Click Choose... and choose your certificate name.
Select the signature you create and then click OK.
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.
Comments (1)Subscribe to this comment's feed