How to sign a VBA program?

L

Lüko Willms

In order to save the users from answering the question if they want
to accept Macros for this current document, or if they want to live in
the fear of rogue macros, I would like to sign my VBA programs, so
that they can decide to trust my macros always and forever.

How do I do that? I found nothing in the online-help.


Yours,
L.W.
 
G

Greg Maxey

L.W.

I don't know how exactly, but look up "Digital Signature" in Word Help
(Not VBA help) and it may give you the information that you need.
 
T

Tobias Schröer

Hi,

Lüko Willms said:
In order to save the users from answering the question if they want
to accept Macros for this current document, or if they want to live in
the fear of rogue macros, I would like to sign my VBA programs, so
that they can decide to trust my macros always and forever.

How do I do that? I found nothing in the online-help.


Yours,
L.W.

hehe, you've found my favourite topic in VBA programming ;)
I nearly smahed my computer when I evaluated this.

In order to sign your VBA code you need a digital certificate. You can
obtain this from a certification center or create your own, using the
SelfCert tool that comes along with MS Office. However, the later works
perfectly fine, but is suggested for development and testing purposed
only. Anyway, I use the self created certificate.

Once you created a digital certificate it is available on the local
computer for code signature. In the VBA Editor, choose "Extras" and
"Digital Signature" (don't know if these are the correct located strings
for english, I use the German language version). Now you can choose a
certificate for signature. Teh code will be signed everytime you change
and save it.
Be aware, that you need the certificate on the computer, if you change
the code!

When the users open a signed document, they must install and trust the
certificate. Then they can select to always trust that certificate and
won't be bothered with the security warning any more.
The certificates can be used for any Office application in the same way.

Sadly, I cannot find the links to the online resoures I used :(

HTH,
Tobi
 
J

Jay Freedman

Hi,



hehe, you've found my favourite topic in VBA programming ;)
I nearly smahed my computer when I evaluated this.

In order to sign your VBA code you need a digital certificate. You can
obtain this from a certification center or create your own, using the
SelfCert tool that comes along with MS Office. However, the later works
perfectly fine, but is suggested for development and testing purposed
only. Anyway, I use the self created certificate.

Once you created a digital certificate it is available on the local
computer for code signature. In the VBA Editor, choose "Extras" and
"Digital Signature" (don't know if these are the correct located strings
for english, I use the German language version). Now you can choose a
certificate for signature. Teh code will be signed everytime you change
and save it.
Be aware, that you need the certificate on the computer, if you change
the code!

When the users open a signed document, they must install and trust the
certificate. Then they can select to always trust that certificate and
won't be bothered with the security warning any more.
The certificates can be used for any Office application in the same way.

Sadly, I cannot find the links to the online resoures I used :(

HTH,
Tobi

Just some additional information:

In English versions of Office, the menu choice is Tools > Digital
Signature.

An article about signing code is at
http://support.microsoft.com/kb/206637.

If you don't work for a company that has installed a certificate
server, and if SelfCert isn't good enough (for example, if you're
selling your work), you have to get a certificate from a Certificate
Authority. The article mentions the companies Verisign and Thawte (see
http://www.verisign.com/products-se...e-signing/digital-ids-code-signing/index.html
and
http://www.thawte.com/ssl-digital-certificates/code-signing/index.html,
respectively). What it doesn't mention is the cost: approximately
US$200 per year for Thawte and US$450 to 500 for Verisign. You have to
sell a lot of macros to cover that. :-(

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
T

Tobias Schröer

Hi,

Jay said:
Just some additional information:

In English versions of Office, the menu choice is Tools > Digital
Signature.

An article about signing code is at
http://support.microsoft.com/kb/206637.

Thanks :)
If you don't work for a company that has installed a certificate
server, and if SelfCert isn't good enough (for example, if you're
selling your work), you have to get a certificate from a Certificate
Authority. The article mentions the companies Verisign and Thawte [..]

However, SelfCert will do. It's just that the certificate is not
"officially" trusted. Beside this, the functionality is the same, if I
got it right. For an individual development, I therefore would say you
can use a SelfCert certificate in a payed project.
What it doesn't mention is the cost: approximately
US$200 per year for Thawte and US$450 to 500 for Verisign. You have to
sell a lot of macros to cover that. :-(

That's bad, true. Either your company (or you by yourself) already own
a certificate, or your customer (for individual development) owns a
certificate you can use, or you must buy, or charge your customer.

Tobi
 
J

Jonathan West

Tobias Schröer said:
Hi,

Jay said:
Just some additional information:

In English versions of Office, the menu choice is Tools > Digital
Signature.

An article about signing code is at
http://support.microsoft.com/kb/206637.

Thanks :)
If you don't work for a company that has installed a certificate
server, and if SelfCert isn't good enough (for example, if you're
selling your work), you have to get a certificate from a Certificate
Authority. The article mentions the companies Verisign and Thawte [..]

However, SelfCert will do. It's just that the certificate is not
"officially" trusted. Beside this, the functionality is the same, if I got
it right. For an individual development, I therefore would say you can use
a SelfCert certificate in a payed project.

That is for you and your customer to decide and agree on. The process of
trusting a Selfcert-generated certificate can be a bit more convoluted.
That's bad, true. Either your company (or you by yourself) already own a
certificate, or your customer (for individual development) owns a
certificate you can use, or you must buy, or charge your customer.

If you do enough to justify it, I think it is a worthwhile cost.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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