Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Digital Signatures for Macros.

Digital Signatures for Macros

Written by Allen Wyatt (last updated May 11, 2020)
This tip applies to Excel 2007 and 2010


2

When you create macros and share them with others, the availability of those macros depends on the security settings on the user's machine. If the security level is set high enough, the user may not even be able to use the macros at all.

One way to help users utilize your macros is to digitally sign them. A digital signature allows a user to know that a macro comes from a trusted source and that it hasn't been modified since it was originally saved by that trusted source. In other words, it is a way for users to be sure that a macro hasn't been tampered with. (Sort of like the product safety seals on some consumer foods and pharmaceuticals.)

In order to digitally sign a macro, you need to first obtain a digital certificate. A certificate is a "seal of approval" from a trusted third party that you are who you say you are. You can get digital certificates from a variety of commercial certificate authorities, each of which has different requirements of how you go about certifying your identity.

You can also create your own digital certificate for testing purposes using the program SelfCert.exe, which is provided with Microsoft Office. This route is great for testing, but it won't help you when you distribute your macros to others; you'll still need the certificate from the third-party authority. You can find more information about the SelfCert.exe program by using Excel's online help and searching for "selfcert."

Once you have a digital certificate, you can digitally sign your macro project in this manner:

  1. In the Visual Basic Editor, use the Project Explorer to select the project you want to sign.
  2. Choose the Digital Signature option from the Tools menu. Excel displays the Digital Signature dialog box.
  3. If there is no digital certificate associated with the workbook, or if you want to use a different digital certificate to sign the macro project than what you used for the workbook, click Choose. You can then select which available certificate you want to use.
  4. Click OK to dismiss the Digital Signature dialog box. The certificate you selected (or the certificate used for the workbook) is then used to sign the macro project.

You can find more information about digital signatures in Excel's Help system. You can also find some great information about both certificates and signatures at this page in the Knowledge Base:

http://support.microsoft.com/kb/820738

Note that the page indicates that it is only for Excel 2003 and 2007. The information is also applicable to Excel 2010.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10486) applies to Microsoft Excel 2007 and 2010. You can find a version of this tip for the older menu interface of Excel here: Digital Signatures for Macros.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Resetting All Shortcut Keys

At some point you might want to wipe out all the custom shortcut keys you've created in Word. This is easy to do by ...

Discover More

Restoring a Keyboard Shortcut

Word uses keyboard shortcuts for all sorts of tasks. Sometimes you may create a shortcut that messes up one of the other ...

Discover More

Accepting All Deletions in a Document

When you use Track Changes in a document, it is easy to amass quite a few edits that you need to accept of reject. If you ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Determining an Integer Value

When creating macros, you often need to process numbers in various ways. VBA allows you to convert a numeric value to an ...

Discover More

Deleting VBA Code in a Copied Worksheet

VBA makes it easy to copy a worksheet from the current workbook into a brand-new workbook. You may want to delete some ...

Discover More

Determining an ANSI Value in a Macro

Need to know the character code used for a particular character? In a macro you can use the Asc function to determine the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five more than 3?

2016-11-23 10:37:29

ThinkAdvantage

How can I check if the Signature is in place?


2014-08-07 08:26:01

RKeev

Does this "PROTECT" the project too? Also, if you use a card, like a common access card (CAC), if you change cards or loose your card you won't have access to the project either correct?

I've used a CAC with digitally signed emails, but when I had my CAC replaced, I could no longer access any of those emails. So as the knight said... Choose wisely.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.