Xlam Addin how to create update process

亡梦爱人 提交于 2021-02-10 20:44:00

问题


I have created XLAM addin ribbon for user needs. Now I need to create update process for bug fixing purposes.

Is it possible to change XLAM file on the fly?


回答1:


Yes this is very doable. Two methods to demonstrate:

  1. Manual method

    • Make sure the add-in file which is in production is set to read-only (right click file, properties, check the box).
    • When you have finished developing, testing, accepting your update, simply replace the file and ensure you set the new copy back to read-only.
  2. Automated method

    • Make sure there is a build number in the file.
    • Have a central location in which you store the current build number
    • Have code in the file which checks its internal build against the external build number
    • If external is higher, propose update
    • Have code that renames the current add-in (either in the add-in itself or in another add-in which handles updates), downloads the new copy and then displays a message to the user stating the add-in was updated, please restart Excel
    • Have code in the add-in which cleans up old copies of the add-in on start-up.

See: http://jkp-ads.com/articles/updateanaddin.asp




回答2:


It is possible to change XLAM file on the fly. However, I wouldn't do so, because if you break the production version then other people's work is disturbed.

I usually handle it like this: I save the xlam to a different workbook in a 'safe' folder- ie one that I have access to. Then I do the editing.

That way, the production version is still working until you fix what you need to in the coding. When your update is working, then make it available for other users.



来源:https://stackoverflow.com/questions/46584990/xlam-addin-how-to-create-update-process

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!