Assign A Digital Signature To A Macro

You can assign a digital signature to any of your macros. You attach signatures to code in a macro, or file, to signify that the code is valid and that no one has modified it since you applied the signature.

You can create two types of digital signatures: certified digital signatures and personal digital signatures. You acquire certified digital signatures from commercial agencies, such as VeriSign, Inc. The signatures of choice when you distribute your code to other users, commercial agencies require you to pay a fee to obtain them. You can also create your own personal digital signature, but Excel does not consider this type of signature certified. Personal digital signatures work well for indicating that no one has altered the macro since you assigned the signature, but they do not certify it like the ones you acquire from a commercial agency. For more on creating a personal digital signature, see Chapter 1.

No matter how you acquire a digital signature, it does not do you any good until you attach it to a macro. Attaching a digital signature is similar to sealing an envelope: If it arrives sealed, no one has tampered with the contents. Keep in mind that the digital signature stays attached to the macro only until someone modifies it. Excel even removes the digital signature if you modify the VBA code. Therefore, if you make any modifications at all to the macro code, you need to re-attach the digital signature.

If you are not sure whether you have modified a macro since attaching the digital signature, you can check to see if the signature is attached in the Digital Signature dialog box. If a digital signature is attached, the name of the signature displays in the Certificate Name field.


File Edit View Insert Format Debug Run m M I X % öl r- » M

(] Sheet2 (Sheet2) hE| SheetS (SheetS) © ThisWorkbook B -H Mt

Module 1 Module -1

Alphabetic | categorized |

Module 1 Module -1

Alphabetic | categorized |

lools I Add-Ins Window Help

I Additional Controls,,,


VBAProject Properties,,.

Digital Signature . .

Keyboard Shor

Range("HIS' Applicatior !nd Sub

—D Click the module that contains the macro you want to sign.


1 by Jinjer Simon cut: Ctr1+Shift+T .Select

CommandB ar s["S top Recording") ,'


File Edit View Insert Format Debug Run lools Add-Ins Window Help M \ - Q ► II %2eS>&*|(3 Ln 11, (

VBAProject (Budget.K_^J

B Sheetl (Sheetl)

g Sheet2(Sheet2)

El Sheet3 (Sheet3)

ThisWorkbook H â Modules ÄMcdul,,

Module 1 Module 3

Alphabetic | Categorized |

Sub Calculate_Total()

le VBA project is currently signed as

Certificate name; Jinjer Simon

■ The macro code displays in the Code window.

'-0 Click Tools O Digital Signature.

■ The Digital Signature dialog box indicates whether you have a digital signature certificate currently assigned to the selected macro.

0 Click Choose.


0 0

Post a comment