This one is driving me nuts. I can "read" all the properties of a commandbarComboBox EXCEPT the value within the box!
Set NewBar = CommandBars.Add(Name:="RADAddin", temporary:=True)
Set SrcCombo = NewBar.Controls.Add(msoControlComboBox, ID:=1, temporary:=True)
Set BarLogin = NewBar.Controls.Add(msoControlComboBox, temporary:=True)
Set BarPwd = NewBar.Controls.Add(msoControlComboBox, temporary:=True)
Set LogInBtn = NewBar.Controls.Add(msoControlButton, temporary:=True)
Set NewBarButton = NewBar.Controls.Add(msoControlButton, temporary:=True)
With SrcCombo
.Visible = True
.Style = msoComboLabel
.DropDownLines = 2
.DropDownWidth = 60
.AddItem "Production"
.AddItem "QA"
.Caption = "Select DataSource: "
.TooltipText = "Select production or QA as source"
End With
With BarLogin
.Visible = True
.Style = msoComboLabel
.DropDownLines = 0
.Caption = "Camelot Login: "
.TooltipText = "Enter Camelot Login ID"
End With
With BarPwd
.Visible = True
.Style = msoComboLabel
.DropDownLines = 0
.Caption = "Password: "
.TooltipText = "Enter Camelot Login password"
End With
With LogInBtn
.Visible = True
.Style = msoButtonCaption
.Caption = "Log In"
.Width = 50
.TooltipText = "Execute Login to Camelot"
.OnAction = "DoLogin"
End With
With NewBarButton
.Visible = True
.Style = msoButtonCaption
.Caption = "New Query"
.TooltipText = "Open Form to Create new filtered Detail grid"
.Enabled = False
.OnAction = "ShowMenu"
End With
With NewBar
' Dock the toolbar at the top of the Microsoft Excel window.
.Position = msoBarTop
.RowIndex = LastRow
' Display the toolbar.
.Visible = True
End With
When the user clicks the "Log In" button, the we want to execute code based on the entries within the comboBoxes. The "OnAction" property of the "Log In" button is stepping into the correct subroutine, but that's where I'm stumped.
I've tried: commandBars("RadAddin").Controls("SrcCombo").text and .value...neither property exists.
What am I doing wrong?
Bookmarks