S
Stuart
Using Office 2000, I open a new document and then insert a
Textbox. I then copy and paste the textbox into a range in an
Excel worksheet.
How can I programmatically reference the textbox, please?
I've set a reference to MS Forms 2.0 in the Library
The following should work with an Excel ActiveX
textbox:
Sub Test()
Dim oleObj As OLEObject, rng As Range
With ActiveWorkbook
For Each oleObj In ActiveWorkbook.Sheets _
("Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = "Bingo"
End If
Next
End With
End Sub
Regards.
Textbox. I then copy and paste the textbox into a range in an
Excel worksheet.
How can I programmatically reference the textbox, please?
I've set a reference to MS Forms 2.0 in the Library
The following should work with an Excel ActiveX
textbox:
Sub Test()
Dim oleObj As OLEObject, rng As Range
With ActiveWorkbook
For Each oleObj In ActiveWorkbook.Sheets _
("Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = "Bingo"
End If
Next
End With
End Sub
Regards.