XL2003

  • Thread starter Thread starter Paul W Smith
  • Start date Start date
P

Paul W Smith

On a worksheet I have placed a TextBox from the ControlToolbox menu. I have
set the locked property to True, however I am amazed that I can still edit
the text that is insdie the box.

I have actually written code on a button which should alloow the user to
change the text, but I cannot seem to find anyway of stopping the user from
just typing into the text box.

Why is the locked property not working?

Paul Smith
 
No I am not still in design mode.

I have also tried applying protection to the page to see if this invokes the
locking - it does not.
 
That will disable the text box shading it's contents.

What I am asking is how or if i can make an activeX text box work on a
worksheet the same way it does on a user form. On a user form, locking the
control has an effect, on a worksheet it does not seem to.

Can anyone confirm this?
 
The effect that I got with a textbox on a protected sheet and locked was that
i could not access the properties window to change any of the properties,
although I could change the text. I believe that is the design.
 
A work around for this:
In the code where you set the value for the text box, first set a cell
somewhere to the same value.

Setting the value of the text box using code (You probably won’t want to use
activesheet but it’s OK for demo):

ActiveSheet.Range("D1") = "My Test"
ActiveSheet.TextBox1 = "My Test"

Now Change event code for text box

Private Sub TextBox1_Change()
TextBox1 = Range("D1")
End Sub

Basically to the user the text box appears locked.
 
Thank for the suggestion.

What I am really looking for from a MVP is confirmation that ActiveX text
boxes cannot be 'locked' when used on a worksheet.

Paul Smith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top