How do I sign a .bas file?

J

Jie Wang [MSFT]

Hi David,

You can't sign a single .BAS file. What you can do is signing 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, or if user profiles
are in use, for a particular user on that computer.

You should do this only after your solution has been tested and is ready
for deployment, because 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.

To lock a VBA project:

1. Open the Visual Basic Editor.

2. In the Project Explorer, right-click the project you want to protect,
and then click ProjectName Properties on the shortcut menu.

3. On the Protection tab, select the Lock project for viewing check box,
enter and confirm the password, and then click OK.

To digitally sign a VBA project

1. Open the document or template that contains the VBA project you want to
sign. For Outlook, open Outlook on the computer that contains the VBA
project you want to sign. If user profiles are in use, log on as the user
whose Outlook VBA project you want to sign.

2. Open the Visual Basic Editor.

3. In the Project Explorer, select the project you want to sign.

4. On the Tools menu, click Digital Signatures. Do one of the following:
* If you haven't previously selected a digital certificate, or want to use
another one, click Choose, select the certificate, and click OK twice.
* Click OK to use the current certificate.

Note: If a VBA project has been signed previously, clicking Choose and
selecting a new digital certificate replaces the previous signature. To
remove a signature from a previously signed project, click Remove.

If you have any further questions regarding this issue, please feel free to
post here.

Best regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

ok - thanks

Hi David,

You can't sign a single .BAS file. What you can do is signing 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, or if user profiles
are in use, for a particular user on that computer.

You should do this only after your solution has been tested and is ready
for deployment, because 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.

To lock a VBA project:

1. Open the Visual Basic Editor.

2. In the Project Explorer, right-click the project you want to protect,
and then click ProjectName Properties on the shortcut menu.

3. On the Protection tab, select the Lock project for viewing check box,
enter and confirm the password, and then click OK.

To digitally sign a VBA project

1. Open the document or template that contains the VBA project you want to
sign. For Outlook, open Outlook on the computer that contains the VBA
project you want to sign. If user profiles are in use, log on as the user
whose Outlook VBA project you want to sign.

2. Open the Visual Basic Editor.

3. In the Project Explorer, select the project you want to sign.

4. On the Tools menu, click Digital Signatures. Do one of the following:
* If you haven't previously selected a digital certificate, or want to use
another one, click Choose, select the certificate, and click OK twice.
* Click OK to use the current certificate.

Note: If a VBA project has been signed previously, clicking Choose and
selecting a new digital certificate replaces the previous signature. To
remove a signature from a previously signed project, click Remove.

If you have any further questions regarding this issue, please feel free to
post here.

Best regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top