Return OLEObjects values or names - two examples

  • Thread starter DataFreakFromUtah
  • Start date
D

DataFreakFromUtah

No question here, just a couple of procedure examples for the archive.


GET VALUES OF OLEObjects on worksheet
GET NAMES OF OLEObject Names on worksheet


Search criteria: Loop through OLEObjects and get values
Return OLEObjects values
List OLEObject Values List OLEObjects values
Get OLEObjects Values
Return OLEObjects names Get OLEOBjects names
OLEObjects name return OLEBObjects values return


Sub OLEObjectNamesReturn()

'Return all or any OLEObjects names to VB message box
Dim oleObj As OLEObject

For Each oleObj In ActiveSheet.OLEObjects
If TypeOf oleObj.Object Is MSForms.HTMLText Then
MsgBox "HTMLText: " & oleObj.Name
End If
Next

End Sub


Sub OLEObjectValueReturn()

'Return any or all OLEObjects values on active worksheet to active worksheet
Dim oleObj As OLEObject

For Each oleObj In ActiveSheet.OLEObjects
If TypeOf oleObj.Object Is MSForms.HTMLText Then
' MsgBox "HTMLText: " & oleObj.Object.Value
ActiveCell.Value = oleObj.Object.Value
ActiveCell.Offset(1, 0).Select
End If
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top