Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Text box problem

I have searched long and hard for the solution to this problem.

I have a complicate form using Excel as a platform and VBA to control and
manage the form.

Its completed by users on a network.

my problem is this:

information from another source is brought into the form and populates
sections of this form. Thi info first goes to a cell on an information sheet
which is not seen or used by user (xlveryhiddedn). this is linked to the text
box. Because this info is more than 1024 characters long but is lno more than
2000 characters long I have used text boxes embedded on the form created
from the control toolbox.

What i now want to do is prevent users from adding to or changing the
information that comes into the form. now i have changed the enabled
propperty to false which does the job BUT this grays the text on view ( not
too much of a problem) but on printing makes it virtually unreadable.

ok with VBA code

hope this enouth info

thanks in advance

--
Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Text box problem

Have you tried setting the 'Locked' property of the textbox to True? You may
have to unlock it programmatically prior to filling it with a value...

UserForm1.TextBox1.Locked = True (or 'False' as needed).

--
Jay


"pjbur2005 via OfficeKB.com" wrote:

I have searched long and hard for the solution to this problem.

I have a complicate form using Excel as a platform and VBA to control and
manage the form.

Its completed by users on a network.

my problem is this:

information from another source is brought into the form and populates
sections of this form. Thi info first goes to a cell on an information sheet
which is not seen or used by user (xlveryhiddedn). this is linked to the text
box. Because this info is more than 1024 characters long but is lno more than
2000 characters long I have used text boxes embedded on the form created
from the control toolbox.

What i now want to do is prevent users from adding to or changing the
information that comes into the form. now i have changed the enabled
propperty to false which does the job BUT this grays the text on view ( not
too much of a problem) but on printing makes it virtually unreadable.

ok with VBA code

hope this enouth info

thanks in advance

--
Message posted via http://www.officekb.com


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Text box problem

Jay thanks for your reply,

the textbox is embedded on a worksheet. when the textbox locked property is
set to true you can still enter text on a protected sheet!

An idea I tried late last night was toto prevent users from alteringthe text
in the textbox was to put another textbox over the top with the enabled
property = false locked = true and backstyle set to transparant. then the
user may clcik on area where text box is but cant att to Textbox 1. Not
ideal but does work

Paul

Jay wrote:
Have you tried setting the 'Locked' property of the textbox to True? You may
have to unlock it programmatically prior to filling it with a value...

UserForm1.TextBox1.Locked = True (or 'False' as needed).

I have searched long and hard for the solution to this problem.

[quoted text clipped - 22 lines]

thanks in advance


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1

  #4   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Text box problem

Nice work-around ! (There's always a way, isn't there?). I thought your
textbox was on a userform, but I get the same result as you experience (can't
lock) when it is on a worksheet. You'd think there would be a way, but I
couldn't find it either.

When a textbox is on a worksheet, you can set its Locked property to True
(as I suggested), but in that case, Locked means that you can't select and
move or resize the box (you can still edit its value as you discovered).
However, when the textbox is on a UserForm, the same Locked property does
lock users from editing the value in the textbox.

I suppose you could potentially insert a new userform with a textbox, set
its locked property to true in its initialize event, and get the result
you're looking for (an uneditable textbox). However, this might not suit
your application (you probably have a good reason for embedding the textbox
on a worksheet and not on a userform).

Forfuture reference in case a userform would work, insert a new userform
into your application, add a textbox to it, and set the userform's initialize
event code to the following:

Private Sub UserForm_Initialize()
Me.TextBox1.Locked = True
End Sub

Also, set the UserForm's "ShowModal" property to False so users can move
around the worksheet while the form (and its textbox) is visible on the
screen.

--
Jay


"pjbur2005 via OfficeKB.com" wrote:

Jay thanks for your reply,

the textbox is embedded on a worksheet. when the textbox locked property is
set to true you can still enter text on a protected sheet!

An idea I tried late last night was toto prevent users from alteringthe text
in the textbox was to put another textbox over the top with the enabled
property = false locked = true and backstyle set to transparant. then the
user may clcik on area where text box is but cant att to Textbox 1. Not
ideal but does work

Paul

Jay wrote:
Have you tried setting the 'Locked' property of the textbox to True? You may
have to unlock it programmatically prior to filling it with a value...

UserForm1.TextBox1.Locked = True (or 'False' as needed).

I have searched long and hard for the solution to this problem.

[quoted text clipped - 22 lines]

thanks in advance


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1


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
Countif - problem counting text, other text gmoore3055 Excel Worksheet Functions 1 February 4th 10 10:30 PM
Text Box problem M&M[_2_] Excel Discussion (Misc queries) 1 August 9th 07 10:36 PM
Large amount of text in cells - Problem text.xls (0/1) Patrick Excel Discussion (Misc queries) 3 May 5th 05 04:10 PM
Large amount of text in cells - Problem text.xls (1/1) Patrick Excel Discussion (Misc queries) 0 May 5th 05 01:23 PM
lots of text in text box problem jasonsweeney[_29_] Excel Programming 1 January 30th 04 01:40 PM


All times are GMT +1. The time now is 04:15 PM.

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"