ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with Combobox.Dropdown method (https://www.excelbanter.com/excel-programming/384682-problem-combobox-dropdown-method.html)

FClifton

Problem with Combobox.Dropdown method
 
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


Alan[_2_]

Problem with Combobox.Dropdown method
 
http://support.microsoft.com/default...;en-us;Q319832

Regards,

Alan


"FClifton" wrote in message
...
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




FClifton

Problem with Combobox.Dropdown method
 
Hi Alan,

Thanks for the link. I read through it but I didn't understand it
completely. It seems I have an unqualified reference, but I'm not sure where
in my code it is or how to fix it. Sorry for being dense! Can you help me
spot the problem?

Thanks!

"Alan" wrote:

http://support.microsoft.com/default...;en-us;Q319832

Regards,

Alan


"FClifton" wrote in message
...
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






All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com