Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to protect a textbox in VBA/Excel 2003 ?

Hi,

When protecting the textboxes in my worksheet, I cannot write text to the
box in VBA. How can I unprotect it in my VBA-code, write text in it and then
protect it again ? I want to prevent that the application user moves the
textbox or alters the content: how to do this ?

Greets,

Tom
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default How to protect a textbox in VBA/Excel 2003 ?

Set lock =false before you write to it and then to locked =true when you are
done writting to it like so:

ActiveSheet.Shapes("TextBox1").Locked = True
Code that writes to the text box goes here
ActiveSheet.Shapes("TextBox1").Locked = False




--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Tom Emmery" wrote:

Hi,

When protecting the textboxes in my worksheet, I cannot write text to the
box in VBA. How can I unprotect it in my VBA-code, write text in it and then
protect it again ? I want to prevent that the application user moves the
textbox or alters the content: how to do this ?

Greets,

Tom

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How to protect a textbox in VBA/Excel 2003 ?

Hi Michael,

This gives a runtime error 1004 Application-defined or object-defined error.
What's wrong ?

Greets,

Tom

"Michael" wrote:

Set lock =false before you write to it and then to locked =true when you are
done writting to it like so:

ActiveSheet.Shapes("TextBox1").Locked = True
Code that writes to the text box goes here
ActiveSheet.Shapes("TextBox1").Locked = False




--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Tom Emmery" wrote:

Hi,

When protecting the textboxes in my worksheet, I cannot write text to the
box in VBA. How can I unprotect it in my VBA-code, write text in it and then
protect it again ? I want to prevent that the application user moves the
textbox or alters the content: how to do this ?

Greets,

Tom

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 Protect file from being deleted L. Roper Excel Discussion (Misc queries) 1 February 27th 08 04:05 PM
textbox in excel 2003 kalyan Excel Worksheet Functions 0 December 4th 07 03:23 PM
how to totally protect data excel 2003 gibsol Excel Discussion (Misc queries) 1 March 23rd 07 02:55 AM
Can't protect some cells in Excel 2003 JMC Excel Discussion (Misc queries) 1 July 26th 06 03:36 PM
Removing textbox padding, how to please, Excel 2000/2003 Mike Excel Programming 2 November 15th 05 12:10 AM


All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"