There are several textboxes in an excel file as ActiveX objects and I want to reach them from codebehind.
I am using ClosedXML for other fields, but I am open for ot
You can iterate all the OLE objects as below and identify the textbox you need by textbox name or textbox Text. Instead of Me, you can use worksheet refrence from outside the workbook or any code.
Private Sub GetActiveXControls()
For Each Item In Me.OLEObjects
'Debug.Print Item.Name
If TypeName(Item.Object) = "TextBox" Then
Debug.Print "text = " & Item.Object.text
End If
Next
End Sub