Excel宏的数字签名 [英] Digital Signature for Excel Macro

查看:410
本文介绍了Excel宏的数字签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的项目中,我们有一个excel模板(.xlt)和一个加载项文件(.xla)。这些文件用于创建数据视图。 Dataview只是一种报告。 xla包含用于创建控件的代码,这些控件用于创建,删除,管理数据视图及其内容。这些控件是在VC ++中创建的OCX控件,用于创建数据视图。我们分别有加载项代码和模板文件。

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.

对xlt和xla进行了数字签名,以确保代码可以防止篡改。在数字签名出现之前,一切工作正常。通过打开模板文件(.xlt)并将文件保存为.xls扩展名来创建dataview,从而不更改经过数字签名的xlt和xla文件。当我们尝试保存此内容时,我们收到以下消息:您正在尝试修改已签名的项目。您没有正确的密钥来签署该项目...。

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 ...."

当我们提供保存更改并放弃签名时,签名仅会针对生成的新文件丢失。对于xlt和xla,签名保持不变。

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.

我们也尝试在excel中手动编辑单元格并保存,但上面的消息没有得到。只有在使用OCX控件创建数据视图并保存它们之后,才会弹出上述消息。

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.

推荐答案

我也遇到了类似的问题。我发现这只是在我的宏将工作表插入或删除工作簿时才发生。事实证明,由于每个工作表都有特定于该工作表的宏,因此添加或删除工作表会有效地修改宏源代码。

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.

感谢Turbo Law的Keith Survell指出正确解决此问题的方向:

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

http://help.turbolaw.com/entries/362246-警告消息您已修改了一个已签名的项目,但您没有该项目的正确键来签名

我找不到能解释此问题的权威Microsoft资源。

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

这篇关于Excel宏的数字签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆