Digital signature on workbook/addin invalid when files moved?

G

Guest

I have a situation where the digital signature I have applied to workbooks and AddIn becomes in valid for no apparent reason (ie the certificate is fine and there are no viruses). It seems to be caused in some way be moving the workbooks/addin to a different location than where they were signed. This is a big issue for me as I want to distribute a set of (signed) workbooks and addin to end users that could install the workbooks/addin in a different location to mine

To summarise the problem

I have a set of workbooks containing signed macros
Each workbook refers to an AddIn containing common functions (also signed
When I use the workbooks and AddIn in the location in which they were signed, everything works fine
If I move the workbooks to another computer in the 'same' location (eg. C:\Program Files\MyApp), everything works fine
If I move the workbooks to a different location (on the signing computer or another computer), changes to the workbooks cannot be saved without invalidating the digital signature, making the workbooks unusable. The error message produced is as shown below


"The macros in this file do not match the digital signature. Only a macro virus would cause this. Please scan for viruses and notify the publisher of this document. Macros will be disabled.



I have generated a reproducible test case. For the test case it does not matter whether the macros are signed with my kosher Verisign Class 3 code-signing certificate or a self-signed certificate. I can supply a copy of my test case

To generate the test case

1. Create an AddIn with a simple function, eg. to display a MsgBox (MyMacro in MyAddIn), sign the AddIn and save to MyFolder (anywhere)
2. Load and install the AddIn in Excel
3. Create a workbook (MyWorkbook) that invokes MyMacro in MyAddin (eg. using a command button OnClick event). Sign the workbook and save to the same folder as the AddIn (MyFolder)
4. Exit Exce
5. MOVE the folder 'MyFolder' to a different location on the filesystem
6. Start Excel without opening any of the above
7. Remove the existing AddIn (MyAddIn) from the AddIns list (Excel will give an error since it can no longer find the AddIn in its original location).
8. Restart Exce
9. Add the AddIn in its new location to the AddIns list
10. Open MyWorkbook
11. Save (^S) MyWorkboo
12. Exit Exce
13. Open MyWorkboo

You should now get the error about signature mismatch

I believe the above test case roughly simulates distributing the signed workbooks and AddIn to end users, who may choose to intall the workbooks and AddIn in a location of their choice. However, it seems that if they choose a location 'different' to the one that the workbooks and Addin were signed at, no changes to the workbooks can be saved without them becoming unusable

I am at my wits end and need a solution to enable me to distribute my workbooks without encountering this problem (and soon!

Regard

Andy Bethel

PS: I am using vanilla Office 2003, Norton Antivirus 2003, Windows XP Pro (fully patched), but the problem seems to be OS and Office version independent, ie. I have seen it on Windows 2000, Office 2000 and Office X
 

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