ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add-In needs to create CommandBar (https://www.excelbanter.com/excel-programming/302253-add-needs-create-commandbar.html)

lucp

Add-In needs to create CommandBar
 
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"

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Add-In needs to create CommandBar
 
Have you tried OnStartupComplete?

--

HTH

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

"lucp " wrote in message Have you
tried ...
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 CommandBar
needs to be created. I have the code for that, but need to know what
event fires when the user selects the Add-In.

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


---
Message posted from http://www.ExcelForum.com/




Papou

Add-In needs to create CommandBar
 
Hi
Workbook_AddinInstall

HTH
Cordially
Pascal

"lucp " a écrit dans le message de
...
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 CommandBar
needs to be created. I have the code for that, but need to know what
event fires when the user selects the Add-In.

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


---
Message posted from http://www.ExcelForum.com/




lucp[_2_]

Add-In needs to create CommandBar
 
papou wrote:
*
Workbook_AddinInstall
* You mean I need a xla/xls file as well to handle the installation of

the Add-In?


---
Message posted from http://www.ExcelForum.com/


lucp[_3_]

Add-In needs to create CommandBar
 
Bob Phillips wrote:
*Have you tried OnStartupComplete?
*


I did, and this is not fired when the user ticks the Add-In in Excel

--
Message posted from http://www.ExcelForum.com


Papou

Add-In needs to create CommandBar
 
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

"lucp " a écrit dans le message de
...
papou wrote:
*
Workbook_AddinInstall
* You mean I need a xla/xls file as well to handle the installation of

the Add-In?


---
Message posted from http://www.ExcelForum.com/




Bob Phillips[_6_]

Add-In needs to create CommandBar
 
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)

"lucp " wrote in message
...
Bob Phillips wrote:
*Have you tried OnStartupComplete?
*


I did, and this is not fired when the user ticks the Add-In in Excel.


---
Message posted from http://www.ExcelForum.com/




Stephen Bullen[_3_]

Add-In needs to create CommandBar
 
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



lucp[_4_]

Add-In needs to create CommandBar
 
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

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:22 PM.

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