Hi
I am in the process of developing a custom tab for the Excel ribbon (2007 and 2010) as an add-in (using Custom UI Editor). However, as I am sure most of you are aware, debugging an Excel add-in can be a real pain because of the process you must go to to remove the add-in and then re-add the add-in to the ribbon.
As a result, I have added a button to my tab that uninstalls the add-in, so as to save myself some time whilst I am in the process of debugging. This button works perfectly. So I decided to make another add-in with a reinstall button that would complement this tab in the following way:
- When I click on the reinstall button, my custom tab is installed and then my reinstall tab is uninstalled (in that order)
- When I click on the uninstall button on the custom tab, my reinstall tab is installed and then my custom tab is uninstalled (again, in that order)
The uninstall button still works perfectly on my custom tab. But when I click on the reinstall button on my second add-in, I get a prompt saying "Cannot run the macro ''Reinstall Adam''s Add-Ins.xlam'!Auto_Remove'. The macro may not be available in this workbook or all the macros may be disabled." but yet the custom tab still installs as it should. (Btw, I would be satisfied if I could stop the error coming up with an
but that doesn't work).
The uninstall function looks like this (called from the custom tab):
And the reinstall function looks like this (called from the second add-in, which is also in its own ribbon developed with Custom UI Editor):
I have also tried changing the above pieces of code so that neither of the two add-ins is attempting to uninstall itself. In this case I have put the
in the
section of the other add-in (i.e. the custom tab uninstalls the reinstall tab when it is installed, and the reinstall tab uninstalls the custom tab when it is installed). The error message is almost the same, just with ''Adam''s Add-Ins'!Auto_Add' instead of ''Reinstall Adam''s Add-Ins'!Auto_Remove'.
Please also note that everything works well if I don't attempt to uninstall the "Reinstall" tab, but I figured that there shouldn't be a problem with doing so because I can do it from the custom tab.
Can someone please help me out with this, I have been working on this for 3 days now and I am getting really frustrated, and something that was supposed to be making my life easier is actually having the opposite effect.
Thanks
I am in the process of developing a custom tab for the Excel ribbon (2007 and 2010) as an add-in (using Custom UI Editor). However, as I am sure most of you are aware, debugging an Excel add-in can be a real pain because of the process you must go to to remove the add-in and then re-add the add-in to the ribbon.
As a result, I have added a button to my tab that uninstalls the add-in, so as to save myself some time whilst I am in the process of debugging. This button works perfectly. So I decided to make another add-in with a reinstall button that would complement this tab in the following way:
- When I click on the reinstall button, my custom tab is installed and then my reinstall tab is uninstalled (in that order)
- When I click on the uninstall button on the custom tab, my reinstall tab is installed and then my custom tab is uninstalled (again, in that order)
The uninstall button still works perfectly on my custom tab. But when I click on the reinstall button on my second add-in, I get a prompt saying "Cannot run the macro ''Reinstall Adam''s Add-Ins.xlam'!Auto_Remove'. The macro may not be available in this workbook or all the macros may be disabled." but yet the custom tab still installs as it should. (Btw, I would be satisfied if I could stop the error coming up with an
Code:
On Error Resume Next
The uninstall function looks like this (called from the custom tab):
Code:
Sub UninstallTab(control As IRibbonControl)
On Error Resume Next
AddIns("Reinstall Adam's Add-Ins").Installed = True
AddIns("Adam's Add-Ins").Installed = False
On Error GoTo 0
End Sub
And the reinstall function looks like this (called from the second add-in, which is also in its own ribbon developed with Custom UI Editor):
Code:
Sub ReinstallTab(control As IRibbonControl)
On Error Resume Next
AddIns("Adam's Add-Ins").Installed = True
AddIns("Reinstall Adam's Add-Ins").Installed = False
On Error GoTo 0
End Sub
I have also tried changing the above pieces of code so that neither of the two add-ins is attempting to uninstall itself. In this case I have put the
Code:
AddIns.Installed = False
Code:
Workbook_AddinInstall()
Please also note that everything works well if I don't attempt to uninstall the "Reinstall" tab, but I figured that there shouldn't be a problem with doing so because I can do it from the custom tab.
Can someone please help me out with this, I have been working on this for 3 days now and I am getting really frustrated, and something that was supposed to be making my life easier is actually having the opposite effect.
Thanks