调试
Dim itm As Object
msgbox(RibbonTabs.SelectedTab.Name)
msgbox(RibbonTabs(RibbonTabs.SelectedTab.Name).Groups(RibbonTabs.SelectedTab.name).Items.count)
For Each itm In RibbonTabs(RibbonTabs.SelectedTab.Name).Groups(RibbonTabs.SelectedTab.name).Items
msgbox(itm.name)
With itm
If RibbonTabs.SelectedTab.Name <> "主界面" OrElse RibbonTabs.SelectedTab.Name <> "月末报表" Then
If TypeOf itm Is RibbonMenu.ComboBox Then
If DataTables(RibbonTabs.SelectedTab.Name).DataCols(itm.name).IsBoolean = False Then
.Items.Clear
For Each c As String In DataTables(RibbonTabs.SelectedTab.Name).SQLGetValues(itm.name, "", itm.name)
Dim b As New RibbonMenu.Button(c)
b.Text = c
.Items.Add(b)
Next
End If
End If
End If
End With
Next