3

i am trying to clear a textbox called "text box 2"

i have tried the following:

TextBox2.Value = ""

^ gets a 424 object required error

TextBox2.Text = ""

^ gets a 424 object required error

Worksheets("Proposal").Textbox2.Value = ""

^ gets a runtime error 438, object doesnt support this property or method

Worksheets("Proposal").Textbox2.Text = ""

^ gets a runtime error 438, object doesnt support this property or method

15
  • Is this an ActiveX text box? Is it directly on your worksheet? Commented Jul 7, 2016 at 17:12
  • how can i verify i am working with an activex textbox? @Kyle Commented Jul 7, 2016 at 17:13
  • Try Proposal.TextBox2.Text = "" Commented Jul 7, 2016 at 17:14
  • ActiveSheet.OLEObjects("text box 2").Object.Value = ""? Also, is it called "text box 2", or is it TextBox2? Commented Jul 7, 2016 at 17:16
  • 1
    Please post the rest of your (relevant) code. Also, can you clarify if the text box is named "text box 2" or if you want to access TextBox2? Right now, as you can see, we're just making some guesses.... Commented Jul 7, 2016 at 17:19

2 Answers 2

2

Since it is a form control:

Worksheets("Proposal").Shapes("Text Box 2").Value = ""

And since you changed it to an ActiveX control:

Worksheets("Proposal").TextBox2.Value = "" 'This assumes that your newly created text box is still "TextBox2"
Sign up to request clarification or add additional context in comments.

Comments

0

Change to ActiveX and use

Proposal.TextBox2.Text = ""

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.