ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Updating an Add-in (https://www.excelbanter.com/excel-programming/322575-updating-add.html)

ExcelMonkey[_190_]

Updating an Add-in
 
I have an Add-in that I have created. Upon installing it
via Tools\Add-Ins.. It creates a new menu item. Now I am
anticipating having to update and distribute this Add-in
as time goes on. However, I will not be using an
installation program to do this. Hence there is a risk
that the user will not install it properly. If the user
does not uninstall the old version first(i.e. delete old
menu item), then upon installing the new version, the menu
item will be installed again (i.e. two menu items that are
exactly the same).

Is is possible to write code that says if upon installing,
if the menu item already exists, then delete the old one
and install the new one?



Tom Ogilvy

Updating an Add-in
 
On Error Resume Next
application.Commandbars("Custom 1").Delete
On Error goto 0

or similar at the beginning of your install routine.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
I have an Add-in that I have created. Upon installing it
via Tools\Add-Ins.. It creates a new menu item. Now I am
anticipating having to update and distribute this Add-in
as time goes on. However, I will not be using an
installation program to do this. Hence there is a risk
that the user will not install it properly. If the user
does not uninstall the old version first(i.e. delete old
menu item), then upon installing the new version, the menu
item will be installed again (i.e. two menu items that are
exactly the same).

Is is possible to write code that says if upon installing,
if the menu item already exists, then delete the old one
and install the new one?





Bernie Deitrick

Updating an Add-in
 
Add this to the top of your code, changing the name to match your button
name, assuming that you have added your button to the Tools menu. Otherwise,
you do something similar.

Dim ToolsMenu As CommandBarPopup
Set ToolsMenu = Application.VBE.CommandBars(1).FindControl(, 30007)
ToolsMenu.Controls("This is your control Name").Delete

HTH,
Bernie
MS Excel MVP

"ExcelMonkey" wrote in message
...
I have an Add-in that I have created. Upon installing it
via Tools\Add-Ins.. It creates a new menu item. Now I am
anticipating having to update and distribute this Add-in
as time goes on. However, I will not be using an
installation program to do this. Hence there is a risk
that the user will not install it properly. If the user
does not uninstall the old version first(i.e. delete old
menu item), then upon installing the new version, the menu
item will be installed again (i.e. two menu items that are
exactly the same).

Is is possible to write code that says if upon installing,
if the menu item already exists, then delete the old one
and install the new one?






All times are GMT +1. The time now is 03:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com