473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help Dispatching Events on excel commandbar buttons

I have the following function which creates buttons on Excel
commandbar. The problem i can't get the buttons to hook up to events.
For example, if i create four buttons only the fourth one fires the
ButtonEvent, the rest do nothing. What am i doing wrong.

Please help

Eric
--------------begin Function--------------------------
def CreateButton(self,menubar,buttons,images,captions, tooltips):
"""Create buttons on the Excel bar"""

if menubar is not None:
if buttons is not None:
i=0
for button in buttons:
button =
menubar.Controls.Add(Type=constants.msoControlButt on,
Parameter="Greetings")
button=self.toolbarButton=
DispatchWithEvents(button, ButtonEvent)
button.BeginGroup = True
button.Width = "34"
if captions:
button.Caption =captions[i]
if tooltips:
button.TooltipText = tooltips[i]
i+=1
----------------------end Function------------------------------
Jul 18 '05 #1
0 1752

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Terry | last post by:
Hi, could someone please exmaplin to me what dynamic method dispatching is and how it's connected to virtual methods? Thanks Terry
1
by: TETLEY | last post by:
I have created a database and have a form containing unbound drop down lists that I use as the source for filters. Does anyone know how I can put the drop down lists from my form into a toolbar ?
3
by: adrian.chandler | last post by:
I have a form with a subform. The subform occupies about the bottom two thirds of the screen. The form has a custom CommandBar docked at the top. The subform also has its own CommandBar. I want...
3
by: Russell Smith | last post by:
I am creating an Excel add-in. Please note project type is Shared Add-in vice Excel Workbook. In the OnStartupComplete event handler I am adding a new menu item. I start by getting a reference...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
0
by: Peter Osawa | last post by:
Hi, I want to develop a COM dll for Excel. When I start VB6, I choose Addin project and I manage to transform it to load with Excel doing the code below... The problem is that I don't know how...
18
by: Frank M. Walter | last post by:
Hello, I have made an small AddIn with udf for excel 2003. I use vs2003. The point of view is the function __T() I call it in excel sheet writing =__T() I am not able to set a value to a...
10
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied...
0
by: vincenzo.papa | last post by:
Hi, I've got the following problem with an office application, written in vb.net 2.0 using the Extensibility.IDTExtensibility2 interface. I crowned an Activex component inside a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.