View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Screen position of commandbar button in Excel 2007 ?

So there's no popup at all, only a routine that's partly named "Popup"
called by a normal button on a normal bar - right?

As I mentioned before, in Excel 2007 custom commandbars do not exist (other
than popups), at least not in the way you intend to use them. Instead the
equivalent controls are added to the Ribbon in the Add-Ins tab.

I don't know how you'd get the position of a Ribbon control, the only
properties it appears to expose in a Call-back (control As IRibbonControl)
are Context, Id & Tag; nothing about location. Whilst not impossible I
suspect it'd be extremely difficult to work out its location.

I didn't get the original objective, something about simulating a
spinbutton - maybe time to put your own controls on the Ribbon, start here -

http://www.rondebruin.nl/ribbon.htm

Also look at Andy Pope's superb Ribbon Editor
http://www.andypope.info/vba/ribboneditor.htm

Regards,
Peter T



"minimaster" wrote in message
...
I'm sorry that my explanation was too complicated, let me try to
explain it more simple plus some code for illustration purposes:

On a commandbar I have a button - snippet from the creation of this
button:

Dim hgCmdBar As CommandBar
Dim combut As CommandBarButton

Set hgCmdBar = Application.CommandBars.Add(Name:="myPivot_Tools")
With hgCmdBar.Controls
Set combut = .Add(msoControlButton)
With combut
.Style = msoButtonIcon
.FaceID=59
.TooltipText = "Show my special custom popup menu
for PivotTable tools"
.OnAction = ShowCustomPopup
.Visible = True
.Enabled = True
End With
End With

in the procedure

Sub ShowCustomPopup()
Dim buttonTop as Long

buttonTop=Application.CommandBars.ActionControl.To p
...
End Sub

I would like to know at which screen position I can find the button
which I have on the above mentioned commandbar.
In Excel 2003 this was as simple as shown above in the code snippet
from Sub ShowCustomPopup()