问题
After a computer reset I wanted to use my VBA Macros for Outlook 2013.
In Outlook I get the error message:
"An errror occured while attempting to verify the VBA project's signature. Macros will be disabled."
Consequently the VBA editor states:
"The macros in this project are disabled. [..]"
I have tried:
Developer -> Macro Security -> (*) Enable all Macros (not only digitally signed)
Define a certificate using
C:\Program Files (x86)\Microsoft Office\Office15\selfcert.exe
Nothing worked. Any idea?
回答1:
Having come across this just now, this is how I ultimately solved it (none of the other suggestions worked for me):
- Create a self cert – I called mine “Self Cert” (generated from here in Office 2013 - C:\Program Files (x86)\Microsoft Office\Office15\SELFCERT.EXE)
- Run certmgr.crt from the start menu and copy “Self Cert” from “Personal\Certificates” to the “Trusted Root Certification Authorities\Certificates” folder
- Open Outlook.exe as Administrator
- Open VBA (i.e. Developer -> Visual Basic)
- Open your module containing the VBA code
- Select Tools -> Digital Signature -> Choose...
- Select OK to select “Self Cert” (VB then shows the project as being signed with this certificate) then click OK again accept and close the window
- Click to save the macro in VBA – actually click the save button in VB (bizarrely it breaks if you don’t expressly save here)
- Close VBA
- Close Outlook, and choose Yes to save the VBA project
- Restart Outlook.exe again as Administrator
- Either now, or after you go “Developer -> Visual Basic” again, a window should pop-up prompting you about the newly signed macro – I clicked remember and don’t prompt again
- Macros should now work! I'm using them as part of an email rule and this now processes perfectly.
I’m not strictly sure you need to run Outlook as an administrator in the above, but it now works without being run as an administrator so I’m happy.
Thanks to this resource for getting this working for me! I've basically just updated, consolidated and expanded on answers given. https://social.technet.microsoft.com/Forums/en-US/07f0158c-085b-4031-93a1-c9d047cf855c/unable-to-sign-outlook-2010-vbaproject?forum=outlook
回答2:
Ok, I found the reason for my problem:
(1) The Certificate nameofmycert
by selfcert.exe was assigned to my VBA project.
(2) However I didn't assign it to a trusted authority, like seen in: https://technet.microsoft.com/en-us/library/cc754841.aspx#BKMK_addlocal
(3) Outlook was set to allow all macros (not only digitally signed). Anyhow it found that my VBA project was certified, but was not sure if the cerification is correct, because of (2). Therefore it deactivated all macros.
(4) In VBA/Tools / Dignital Signature it appeared:
Certificate name: [no certificate]
Sign as: nameofmycert
The remove-botton was deactivated.
Solution:
(1) VBA/Tools / Digital Signature
(2) Click on Choose ..
and select a cerificate. Then the remove-botton is activated.
(3) Click on Remove Certificate
(4) Save VBA project
(5) Restart Outlook
回答3:
I had this same problem and the solution here fixed it: https://social.technet.microsoft.com/Forums/en-US/07f0158c-085b-4031-93a1-c9d047cf855c/unable-to-sign-outlook-2010-vbaproject?forum=outlook. The thread is long, but the gist of it is you need to manually save your VBA project after signing, and before exiting the VBA editor. Scroll down about 2/3rds of the way to the post by "Diane Poremsky [MVP]".
回答4:
You need to change the Trust Center settings (run all macros, not only digitally signed) or purchase a valid certificate from a trusted authority.
来源:https://stackoverflow.com/questions/30619881/microsoft-outlook-2013-error-verify-vba-project-signature