View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] condotta@shaw.ca is offline
external usenet poster
 
Posts: 5
Default Custom ribbon dropdown

Hello,

I have a custom ribbon tab that contains two dropdowns. Dropdown(1)
has a GetSelectedItemIndex built in to show a value corresponding to
the selected worksheet name when opened/activated. Dropdrown(2) does
not require this. When I select a dropdown(1) value, dropdown(2) is
Invalidated and resets its list showing a blank value allowing the
user to reselect any value. This is by design and works great. When I
select a dropdown(2) value, dropdown(1) is also Invalidated to reset
its values but its GetSelectedItemIndex does not allow the control to
show a blank allowing the user to select any value. I have tried to
intercept this by setting dropdown(1)'s Index to "-1", but this
produces an error. How can I get around this?

'Callback for Dropdown getSelectedItemIndex
Sub GetDropdownIndex(control As IRibbonControl, ByRef Index)

Select Case control.id

Case "Dropdown(1)"

If ActiveSheet.Name = "CFSTotals" Then
' Sets the timesheet dropdown to a blank????
Index = -1
Else
' Sets the timesheet dropdown value to active
worksheet.
Index = Workbooks(gsEmployee &
".xlsx").ActiveSheet.Index - 1
End If

End Select
End Sub