Re: Problem Code Signing a VBA Macro in an Excel 2002/2003

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Peter (peterguy)
Date: 11/18/04


Date: Thu, 18 Nov 2004 10:33:05 -0800

Did you try talking to your cert provider, Comodo? Perhaps you need to add "Microsoft Enhanced Cryptographic Provider v1.0" as a reference to the project? Shots in the twilight.

The following doesn't directly answer your question, but suggests a different way to achieve trustedness for your macros (which might be of no interest to you since you've already forked out the dough for a cert).
I know that Word defines certain folders as "trusted locations", and that if a macro is loaded from one of those locations, it is trusted implicitly, w/out having to be signed, as long as the "trust all installed add-ins and templates" checkbox is checked (IIRC, it's checked by default). Excel has a similar setup, doesn't seem to be quite as rich as Word's setup. I don't know how to display/set the trusted locations via a GUI, but the following properties can be accessed programmatically:

Application.NetworkTemplatesPath
Application.TemplatesPath
Application.StartupPath

As I understand it, if you put your macros in any of the those three folders, Excel should accept them as trusted and not complain about running them as long as the aforementioned checkbox is checked, unless security is set to "very high" (2003 only), then they would have to be signed _and_ put in those folders.
At least, that's how I understand it.

Anyone have more insight, please correct/expand on this.

A bit more info here:
http://office.microsoft.com/en-us/assistance/HA011189901033.aspx

hth,

-Peter

"Stephen Davies" <StephenDavies@discussions.microsoft.com> wrote in message news:35539BAE-72B5-47BE-98E9-A8FD22CC593E@microsoft.com...
> I have obtained a Digital Code Signing certificate from Comodo (InstantSSL)
> and installed it in my Certificate Store. It has a 1024 bit key using
> Microsoft Enhanced Cryptographic Provider v1.0.
>
> After opening my Excel spreadsheet I edit the macros (Alt-F11) click on the
> project and select Tools|Digital Signatures.
>
> From here Choose my certificate and click OK, this informs me that the VBA
> project is currently signed by my company (viewing the cert shows it was
> issued by Comodo).
>
> Close the VBA editor and save the worksheet. In Excel 2002 the spreadsheet
> closes without question. In Excel 2003 I receive the message
>
> --------------------------------------------
> There were problems with the digital certificate. The VBA project could not
> be signed. The signature will be discarded.
> --------------------------------------------
>
> When I open either the 2002 or 2003 sheet, edit the VBA project and view the
> digital certificate nothing is install and of course the spreadsheet
> complains about the macros not being signed on medium & high security setting.
>
> Whats going wrong here, it all worked will with the TEST self signed
> certificate, I just now need to do the real thing.
>
> --
> Regards
> Stephen Davies



Relevant Pages

  • Re: Insurance Certificates Database
    ... table based on a questionnaire, ... We did have a commercial certificate tracking application a while back, ... I agree my Indefinite Cert Fields look like fixed attributes of the ... firm. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Insurance Certificates Database
    ... I agree my Indefinite Cert Fields look like fixed attributes of the ... piece of data as an attribute of the insurance certificate (excepting firm ID ... The Policies table presents more of a problem than the Certs table, ... I suggested having a different table for each type of policy to solve this ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Insurance Certificates Database
    ... table based on a questionnaire, ... We did have a commercial certificate tracking application a while back, ... breaking the data down into various tables, ie normalization. ... I agree my Indefinite Cert Fields look like fixed attributes of the ...
    (microsoft.public.access.tablesdbdesign)
  • Re: ADFS Token-signing Certs Not in Trusted Root Store
    ... This is good info, Joe. ... So now I know that the token-signing certificate is ... Get a signing cert from a CA ... case, you never have to worry about expiration or CRL checking, as your cert ...
    (microsoft.public.windows.server.active_directory)
  • Re: Issues with SSL on Win CE 5.0
    ... the HKCU certificate store. ... and tell the web server to use it. ... The old cert was in. ...
    (microsoft.public.windowsce.embedded)