2
votes

In our project we have an excel template (.xlt) and an add-ins file (.xla). These files are used to create a dataview. Dataview is nothing but a kind of report. The xla contains code to create controls for creating, deleting, managing the dataview and its contents. These controls are OCX controls created in VC++ for creating the dataview. We have the add-ins code separately and the template file separately.

The xlt and xla was digitally signed for ensuring that the code is tamper proof. Everything was working fine until digital signature came into picture. The dataview is created by opening the template file (.xlt) and saving the file in .xls extension thereby not changing the digitally signed xlt and xla files. When we try to save this we get the following message "YOu are trying to modify a signed project. You do not have the right key to sign the project ...."

When we give Save changes and discard signature the signature is lost only for the new file generated. The signature remains the same for xlt and xla.

We also tried to manually edit the cells in the excel and save it but we do not get this above message. Only after creating the dataview using the OCX control and saving them pop ups the above message.

2

2 Answers

0
votes

What are you trying to protect? Did you sign the entire workbook / template, or did you sign only the code?

The .xls is a copy of the .xlt, so the template signature is also copied to the xls. Ideas:

  1. Try signing only the code in the template. In the IDE, use Tools -> Digital Signature (Excel 2002/2003)
  2. Remove all the code from the template and put it in the add in
  3. If that's too hard, make a second add in with only the code from the template
0
votes

I too had a similar problem. I found out that it was only happening when my macros would insert or delete a worksheet into the workbook. It turns out that because each worksheet has macros specific to that worksheet adding or deleting worksheets effectively modifies the macro source code.

Thanks to Keith Survell at Turbo Law for getting me pointed in the right direction on this issue:

http://help.turbolaw.com/entries/362246-warning-message-you-have-modified-a-signed-project-you-do-not-have-the-right-key-to-sign-this-projec

I have not been able to find an authoritative Microsoft source that explains this issue.