问题描述
我有一个Excel 2003加载项部署在我们的一个部门,偶尔需要更新。目前发生的是我将新版本从我的机器发布到中央位置,这会更新存储在数据库中的版本号,加载项每次运行其中的任何模块时都会检查,如果更新的版本号然后加载项将停止,并显示一条消息,通知用户他们需要更新加载项。
I have an Excel 2003 add-in deployed in one of our departments that occasionally needs updated. What currently happens is that I publish the new version from my machine to a central location, this updates a version number stored in a database that the add-in checks each time any of the modules within it are run, and if a newer version number is found then the add-in halts with a message informing the user that they need to update the add-in.
这个目前涉及到运行另一个工作簿的 workbook_open
更改加载项的事件。
This currently involves them running another workbook with a workbook_open
event that changes the add-in.
我想要的是加载项检测较新版本可用,并在进行用户操作之前静默安装。问题是,在卸载现有版本的第一步上,这种情况会失败,因为加载项中的任何代码将在卸载后的加载项中立即完成。
What I'd like to have is the add-in detect that a newer version is available and silently install it before carrying on with the user's operation. The problem is that this fails on the first step of uninstalling the existing version because any code in the add-in immediately finishes when the add-in in uninstalled.
在用户的personal.xls中创建一些代码来处理切换,但是我无法在用户的机器中设置对Visual basic项目的信任访问标志,因此在附加组件中不能有复制代码, in。
I would create some code in the user's personal.xls on-the-fly to handle the changeover but I am unable to set the 'Trust access to Visual basic project' flag in the users' machines so can't have replicating code in the add-in.
从这里我可以看到的唯一方法是拥有两个加载项,一个用于处理更新的加载项,另一个实际执行此操作。问题来了,当我不可避免地必须更新更新加载项!
The only way I can see from here is to have two add-ins, one that handles the updates and one that actually does the work. The problem comes when I inevitably have to update the update add-in!
任何人都可以提出更好的解决方案?这必须是100%的Excel,没有VSTO等。
Can anyone else suggest a better solution? This must be 100% Excel, no VSTO etc.
推荐答案
Dick Kusleika很高兴关于管理加载项的博客!
It was nice of Dick Kusleika to blog about managing add-ins today!
可以应用于我的情况的一些好的建议。
Some good suggestions that can be applied to my situation there.
这篇关于更新Excel加载项的过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!