views:

370

answers:

1

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.

Please let us know if there are any suggestions from your end.

A: 

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
DaveParillo