S
Stuart
Using Office 2000, I open Word and in a new document
I insert a Textbox. I then copy and paste it into a worksheet.
I cannot find a way to programmatically refer to it.
Sub Test()
Dim oleObj As OLEObject, rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = "Bingo"
End If
Next
End Sub
The 'If' statement gives the error:
User defined type not defined
How do I control the Textbox, please?
I insert a Textbox. I then copy and paste it into a worksheet.
I cannot find a way to programmatically refer to it.
Sub Test()
Dim oleObj As OLEObject, rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = "Bingo"
End If
Next
End Sub
The 'If' statement gives the error:
User defined type not defined
How do I control the Textbox, please?