View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
bllittle bllittle is offline
external usenet poster
 
Posts: 9
Default Type Mismatch error when trying to generically set ComboBox to aComboBox variable

Part way there!

I didn't realize that OLEObject is not really the object embedded in
the worksheet. ;-) By adding a dim statement for an OLEObject and
adding a step to the set assignments, I do get to the actual ComboBox
item and the code generally works. I have another bug with the
recordset assignments, but that should be fixable now that I have this
object model step through issue worked out. Here is an assignment that
works:

Dim cmbTemp As ComboBox
Dim objTemp As OLEObject
..... other objects dim'ed...

..... stuff to get worksheet names I want to deal with...

With .Worksheets(strTargetWorksheet)
strTargetCmb = strDropDownMaintenance(2, i1)
Set objTemp = .OLEObjects(strTargetCmb)
Set cmbTemp = objTemp.Object
Set objDropDownMaintenance(1, i1) = cmbTemp
End With