Digitally signed Office macros (VB)

  • Drucken

Most times, when using small but handy macros written and embedded in Office programs, there is a complaining about potential risk when opening files containing macros. And if you often use them this somewhen starts being a pain in the ass. Or, even worse, you're not able to open your own file since it's containing macro stuff.

But there's a quite simple solution coming around this - why not signing the macros?

All you need is an Office installation bringing along. There's a programm called selfcert.exe in the Office directory (in my case that's c:\Program Files (x86)\Microsoft Office\Office14\).

When staring this you will be prompted for a certificate name, give it a meaningfule, like hl_vba_signature. The certificate will be generated in an instant. Then, all you need to do is going to the developer tab, open Visual Basic Editor and in "Extras" (whoops, what is it called in the English version?) you can select Digital signatures. There you can select your generated certificate for signing your own macros. When done, don't forget to save your word file as .dotm so the macros are stored along with it.