I have the following problem using the office 9.0 object library. When I
generate the Office 9.0 Object library using makepy the following code
does not work, but when I use the dynamic dispatch method it does. How
do I solve the problem using the early bound dispatch method as I need
early binding for other features (constants etc)?
This method is defined in my server class and the self.application
attribute points to a valid Excel.Application instance
cbMenuBar = self.application.CommandBars("Worksheet Menu Bar")
muCustom = cbMenuBar.Controls.Add(Type = 10) # msoControlPopup
muCustom.Caption = "Toolkit"
item = muCustom.Controls.Add(Type = 1) # msoControlButton
item.Caption = "Show Data Form"
The problem is on line 7. muCustom is of type CommandBarControl in the
early binding case. In the late(dynamic) binding case it is a
CommandBarPopup. CommandBarControl does not have a Controls property
where CommandBarPopup does.
How can i rectify the problem? (typecast ?) How?
Gerrit van Dyk