G
Guest
I have a form with 3 dropdown comboboxes named ComboBoxForms, ComboBoxGroups
and ComboBoxDevices. I want when ComboBoxGroups is changed for
ComboBoxDevices to get the focus and dropdown so its list is visible. I have
the code below to do this. The code seems to work, as the ComboBoxDevices
gets the focus and drops down. However, after that, upon exit from the sub as
far as I can tell, I get the error "Run-time error '-2147417848 (80010108)':
Automation error The object invoked has disconnected from its clients." Help!
I have no idea what this means or how to correct it!
Private Sub ComboBoxGroups_Change()
' update the devices to match the group
ComboBoxDevices.Clear
If ComboBoxGroups.Value = "" Then Exit Sub
groupstart = ThisWorkbook.Groups_Select(ComboBoxGroups.Value)
countDevices = ThisWorkbook.Devices_ListGroup(groupstart, grouplist)
If countDevices > 0 Then
ComboBoxDevices.Visible = True
LabelDeviceLabel.Visible = True
ComboBoxDevices.list() = grouplist
ComboBoxDevices.SetFocus
ComboBoxDevices.DropDown
Else
ComboBoxDevices.Visible = False
LabelDeviceLabel.Visible = False
End If
End Sub
and ComboBoxDevices. I want when ComboBoxGroups is changed for
ComboBoxDevices to get the focus and dropdown so its list is visible. I have
the code below to do this. The code seems to work, as the ComboBoxDevices
gets the focus and drops down. However, after that, upon exit from the sub as
far as I can tell, I get the error "Run-time error '-2147417848 (80010108)':
Automation error The object invoked has disconnected from its clients." Help!
I have no idea what this means or how to correct it!
Private Sub ComboBoxGroups_Change()
' update the devices to match the group
ComboBoxDevices.Clear
If ComboBoxGroups.Value = "" Then Exit Sub
groupstart = ThisWorkbook.Groups_Select(ComboBoxGroups.Value)
countDevices = ThisWorkbook.Devices_ListGroup(groupstart, grouplist)
If countDevices > 0 Then
ComboBoxDevices.Visible = True
LabelDeviceLabel.Visible = True
ComboBoxDevices.list() = grouplist
ComboBoxDevices.SetFocus
ComboBoxDevices.DropDown
Else
ComboBoxDevices.Visible = False
LabelDeviceLabel.Visible = False
End If
End Sub