I am trying to access the text that is entered inside of a textbox object with a VBA macro. My macro breaks when I attempt to execute it, generating the message "Run-time error '438' - Object doesn't support this property or method".
My macro (simplified, but still generates error as written):
I tried my best to search the forums for an existing discussions about this, but every mention I have seen assumes that Sheets("Pivot Table).TextBox1.Text will pass on the contents of the textbox.
I have also tried:
and:
Any thoughts? [Excel 2013 on Windows 8]
My macro (simplified, but still generates error as written):
Code:
Sub Test()
MsgBox Sheets("Pivot Table").TextBox1.Text
Sheets("Pivot Table").Range("B10") = Sheets("Pivot Table").TextBox1.Text
End Sub
I tried my best to search the forums for an existing discussions about this, but every mention I have seen assumes that Sheets("Pivot Table).TextBox1.Text will pass on the contents of the textbox.
I have also tried:
Code:
Dim variable as String
variable = TextBox1.Text
and:
Code:
Dim variable as String
variable = ActiveSheet.TextBox1.Text
Any thoughts? [Excel 2013 on Windows 8]