Assign a Digital Signature to a Macro
A digital signature provides assurance that a workbook file is valid and no one has altered it. There are two types of digital signatures: personal digital signatures and commercial digital signatures. You can create a personal digital signature by using the Microsoft Selfcert.exe tool, or you can purchase a digital signature. Refer to the section, "Create a Digital Signature," to learn how to create digital signatures.
After you create a digital signature, you must attach it to your workbook. Attaching a digital signature is similar to sealing an envelope. If an envelope arrives sealed, you have some level of assurance that no one has tampered with its contents.
Use the Digital Signature dialog box to attach a digital signature. The Visual Basic Editor is a separate Excel module that you can use to edit your macro. You access the Digital Signature dialog box by opening the Visual Basic Editor. The Digital Signature dialog box lists valid certificates. You can use the Digital Signature dialog box to view certificates and to select the one you want to use.
Unless you have on your computer a valid digital signature certificate for the signature used to sign a macro, Excel removes the digital signature if you modify a macro in a workbook, and you must reattach it. If you are not sure if a workbook has a digital signature, you can check the signature by reviewing the Digital Signature dialog box. If a workbook has a digital signature, the name of the signature appears in the Certificate Name field. If you click the Remove button in the Digital Signature dialog box, Excel removes the digital signature.
See how to assign:
- Click the Developer tab.
- Click Visual Basic in the Code group.
The Visual Basic Editor appears. - Click Tools> Digital Signature.
The Digital Signature dialog box appears. - Click Choose. The Select Certificate dialog box appears.
- Click the signature you want to apply.
- Click OK to close the Select Certificate dialog box.
- Click OK to close the Digital Signature dialog box.
Excel attaches the digital signature to your workbook.