Add-In needs to create CommandBar

L

lucp

I create a Add-In using VB6 with Initial Load Behaviour set to "None".
When the users selects the specified Add-In in Excel, a CommandBa
needs to be created. I have the code for that, but need to know wha
event fires when the user selects the Add-In.

Normally this code is placed in the OnConnection sub, but this onl
works when Initial Load Behaviour is set to eg. "Startup"
 
B

Bob Phillips

Have you tried OnStartupComplete?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
P

papou

No but as I have just noticed you are using VB6, so this probably is not
applicable in your case.
The Workbook_AddinInstall is an Excel Application event which fires each
time an Addin has been ticked (loaded) in the Tools AddIns option from
Excel.
HTH
Cordially
Pascal
 
B

Bob Phillips

The OnCoplnnection event fires when the addin loads, regardelss of whether
it is manually loaded, or loaded at startup, OnStartupComplete only fires if
loaded at startup, so it must be the OnCoinnection event that you want.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
S

Stephen Bullen

Hi Lucp,
Normally this code is placed in the OnConnection sub, but this only
works when Initial Load Behaviour is set to eg. "Startup".

OnConnection fires when the user ticks the addin in the COM Addins
dialog. In the OnConnection event, you check to see if your menu
already exists and add it if not (permanently and with the OnAction set
to <!MyProject.MyConnect>, so your addin also loads when it's clicked).
Either way, you then set up your event hook (withevents variable) to
use it.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie
 
L

lucp

OnConnection fires when the user ticks the addin in the COM Addin
dialog.

When I put a msgbox in the AddinInstance_OnConnection trigger, it isn'
displayed when the user ticks the addin in Excel. In VB6, the Initia
Load Behaviour is set to Load on demand.

When the Initial Load Behaviour is set to Startup, the message i
displayed. But this is not what I want
 
Top