Showing posts with label VBA project. Show all posts
Showing posts with label VBA project. Show all posts

2007/11/23

Digital Signatures in Excel 2007 and Excel 2003

If you want to add a digital signature to your excel file, follow steps below.

Microsoft Office Excel 2007

Press the Microsoft Office Button > Prepare > Add a Digital Signature > OK.
Don't forget to save your Excel workbook in the Excel 2007 workbook format, before you add signatures.
If you get the warning message asking "Do you want to save the workbook as a Microsoft Office Excel Workbook?", click "Yes" and select the Excel Workbook (*.xlsx) format in the Save As dialog box.
When the workbook is saved, the dialog box "Get a Digital ID " is displayed. Choose the type of digital ID that you want to use, and then press "OK".
After you complete the before mentioned steps for the type of digital ID, the Excel workbook is signed.

Microsoft Office Excel 2003

Go to Tools menu > Options > Security tab > Digital Signatures > Add.
If you changed your Excel file and is didn't save it yet, or if you didn't save it in the Excel 2003 workbook format, the message "This workbook must be saved as a Microsoft Excel workbook before it can be digitally signed. Do you want to save the workbook?" appears.
You should save the file in the Microsoft Excel Workbook format to add the digital signature.
After your workbook is saved, the Select Certificate dialog box appears. Select the certificate to use, and click "OK".
Close the Digital Signatures dialog box (Click "OK").
You Excel workbook is signed.

2007/11/02

VBA Digital Signature

Digital Signature for VBA Project

Once you have your digital certificate installed, you can sign the VBA projects associated with Word, Excel, and PowerPoint documents, templates, and add-ins. For Outlook, you can sign the VBA project that is associated with the installation of Outlook on a particular computer. Any time code in a signed VBA project is modified in any way, its digital signature is removed. However, modifying the contents of the document other than the VBA code won't invalidate the signature on a VBA project contained within the document. This is because only the VBA project is signed, not the entire document.
If you want to prevent users of your solution from accidentally modifying your
VBA code and invalidating your signature, lock the VBA project before signing it. Locking your VBA project doesn't prevent another user from replacing the with another digital signature. This is allowed so that a system administrator or end user can replace a current signature with an approved signature or re-sign a document after a previous signature expires.
Similarly, if you produce an add-in that adds code to a document's VBA project, your code should determine if the project is digitally signed and notify the user of the consequences of modifying a signed VBA project before continuing.

VBA Digital Signature - How to sign VBA projects

You create digital signature for VBA (Visual Basic for Applications) project by using a digital certificate.
If you don't already have a digital certificate, you must obtain one.
You can obtain a digital certificate from a commercial certification authority, such as VeriSign, Inc., or from your internal security administrator or Information Technology (IT) professional. Or, you can create a digital signature yourself by using the Selfcert.exe tool.
Because a digital certificate you create yourself isn't issued by a formal certification authority, VBA projects signed by using such a certificate are referred to as self-signed projects. Depending on how Microsoft Office digital-signature features are being used in your organization, you might be prevented from using such a certificate, and other users might not be able to run self-signed macros for security reasons.

Steps for VBA Digital Signature

2. Open the file that contains the VBA project you want to sign.
3. On the Tools menu, point to Macro, and then click Visual Basic Editor.
4. In the Project Explorer, select the project you want to sign.
5. On the Tools menu, click Digital Signature.
6. If you haven't previously selected a digital certificate or want to use another one, click Choose, select the certificate, and then click OK twice.
7. To use the current certificate, click OK.