View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Error: Unable to get the OLEObjects property of the worksheet class

the collection doesn't, but he isn't using the collection. Since he has
indexed into the collection, he is using and OleObject.

I got that error if the OleObject name was not cboLine. If you are using
Excel 97, if you change the name of the combobox in the properties window,
this doesn't change the OleObject name.

You might try testing the names with code like

Sub RevealName()
Dim oleObj As OLEObject, cbo As MSforms.ComboBox
For Each oleObj In ActiveSheet.OLEObjects
If TypeOf oleObj.Object Is MSforms.ComboBox Then
Set cbo = oleObj.Object
MsgBox oleObj.Name & " - " & cbo.Name
End If
Next

End Sub

--
Regards,
Tom Ogilvy


"NickHK" wrote in message
...
Grant,
According to the Object Browser, the OLEObjects collection does not have a
property called "Object'.
What are you trying to achieve ?

NickHK

"Grant" wrote in message
...
Hi there,

I keep getting the following error with the following
code. How might I go around fixing it?

Error: 1004, Unable to get the OLEObjects property of the
Worksheet class.

str = ActiveSheet.OLEObjects("cboLine").Object.Value

Thanks in advance for the replies,

Grant.