EXCENSUSNEP
New Member
On ribbon I have a custom dropDown (dd1) and a button (btnRight)
DropDown is for navigate some Sheets: \[code\]Sub DDItemCount(control As IRibbonControl, ByRef returnedVal)returnedVal = Sheets.Count - 2End SubSub DDListItem(control As IRibbonControl, index As Integer, ByRef returnedVal)returnedVal = UCase(Sheets(index + 1).Name)End SubSub DDOnAction(control As IRibbonControl, ID As String, index As Integer)Sheets(index + 1).ActivateEnd SubSub DDItemSelectedIndex(control As IRibbonControl, ByRef returnedVal)returnedVal = Sheets.Count - 3End SubSub btnRight(Optional control As IRibbonControl)dd1.DDItemSelectedIndex = Sheets.Count - 3 ' Error: Object requiredEnd Sub\[/code\]So, how can I change dropDown value (i.e. SelectedIndex) by clicking on Button ?
DropDown is for navigate some Sheets: \[code\]Sub DDItemCount(control As IRibbonControl, ByRef returnedVal)returnedVal = Sheets.Count - 2End SubSub DDListItem(control As IRibbonControl, index As Integer, ByRef returnedVal)returnedVal = UCase(Sheets(index + 1).Name)End SubSub DDOnAction(control As IRibbonControl, ID As String, index As Integer)Sheets(index + 1).ActivateEnd SubSub DDItemSelectedIndex(control As IRibbonControl, ByRef returnedVal)returnedVal = Sheets.Count - 3End SubSub btnRight(Optional control As IRibbonControl)dd1.DDItemSelectedIndex = Sheets.Count - 3 ' Error: Object requiredEnd Sub\[/code\]So, how can I change dropDown value (i.e. SelectedIndex) by clicking on Button ?