Hi HAbib,
Referring to your OP perhaps you don't want to delete the toolbar when the
addin unloads. If so don't set the toolbar's Temporary property True and
don't delete in the file's close event.
With this arrangement it's NOT necessary to install the addin into the addin
manager (with code or with user Tools / Options / Addins…).
When user clicks on your toolbar if your addin is not already loaded it will
automatically load.
You could have an additional button linking to a routine to close the addin
if no longer required in the current session. Maybe also make the toolbar
invisible on unload, eg when Excel closes if not before.
In the open routine test if your toolbar exists, if not create it, if it
does check it is all correct. There are plenty of unused icons that if
suitable might avoid necessity of creating custom icons.
Advise user to simply double click the addin in it's folder first time to
load and create the toolbar. When user closes Excel there should be no other
running instances to ensure it gets stored in user's toolbar / *.xlb file).
This is certainly NOT the normal way to distribute an addin and could
antagonise users. However it might fit your user's particular requirements,
a) knows how to make the toolbar visible, b) infrequent use (addin only gets
loaded when specifically required), c) knows how to recover the toolbar if
it accidentally gets deleted (load addin from file).
Regards,
Peter T
"HSalim[MVP]" wrote in message
...
Tom,
Thanks for the super-fast reply, and for all the links.
I did find Jan Karel's site, and have been trying to follow his advice.
I cant put my finger on what I am doing wrong, but I think I am
permanently
deleting the toolbar.
I've had to recreate my toolbar a few times now as I seem to delete it.
Is there a way to backup a toolbar?
I could create the toolbar in code like JKP does - perhaps that is the
answer.
How do I save the button images so that I can create the toolbar with the
images I want?
REgards
HAbib
"Tom Ogilvy" wrote in message
...
: http://support.microsoft.com/?id=167909
: XL: Securing Visual Basic Code in Microsoft Excel
:
: http://support.microsoft.com/?id=156942
: XL97: How to Create an Add-in File in Microsoft Excel 97
:
: http://support.microsoft.com/?id=211563
: How to create an add-in file in Excel 2000
:
: http://msdn.microsoft.com/library/en...xceladdins.asp
:
:
http://msdn.microsoft.com/library/en...tingexceladdin.
asp
:
: http://www.j-walk.com/ss/excel/tips/tip45.htm
: Excel 97: Creating Add-Ins
:
: You addin should delete any existing version of the toolbar and create a
new
: version when it is loaded. It should also mark it as temporary and
delete
it
: in the beforeclose event. The creation can be done in the
workbook_open
: event of the addin.
:
: If the user will only load the addin when they want to use it, then this
: should be sufficient. If they will load the addin all the time, then it
: depends on the user. In tools=Customize, they can select whether the
bar
: is visible or not. If that is too hard, then perhaps you could provide
a
: function in your addin that they can run from Tools=Macro=Macros or
you
: can add an additional menu choice in the tools menu.
:
: --
: Regards,
: Tom Ogilvy
:
:
:
: "HSalim[MVP]" wrote in message
: ...
: How do I create an add-in and distribute it to others?
: I have a toolbar associated with the add-in. The user wants the
toolbar
: to
: be invisible most of the time. When she wants to use the add-in -
: approximately once a month, she will make the toolbar visible.
: What is the best way to achieve this?
: Thanks
: Habib
:
:
:
: