Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Userform and controls locked property

Can I lock all userform controls by code upon form activation?

D.S.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Userform and controls locked property

Private Sub UserForm_Initialize()
Dim ctl As Control
For Each ctl In Controls
On Error GoTo ErrorHandler
ctl.Locked = True
'ctl.Enabled = False
Next
Exit Sub
ErrorHandler:
If Err.Number = 438 Then Resume Next
End Sub

Why would you want to do this?

--

Vasant


"D.S." wrote in message
...
Can I lock all userform controls by code upon form activation?

D.S.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Userform and controls locked property

An easier way is to place a set of controls onto a Frame and set the frame's Enabled property to false.

--
HTH. Best wishes Harald
Followup to newsgroup only please

"D.S." skrev i melding ...
Can I lock all userform controls by code upon form activation?

D.S.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Userform and controls locked property

Thanks to both. The reason I want to do this?

I should have been more specific, I only needed to disable all the textboxes. I want to prevent the user from making direct entries in the textboxes, as they are intended to be populated only by a procedure that will be triggered.

D.S.
"Harald Staff" wrote in message ...
An easier way is to place a set of controls onto a Frame and set the frame's Enabled property to false.

--
HTH. Best wishes Harald
Followup to newsgroup only please

"D.S." skrev i melding ...
Can I lock all userform controls by code upon form activation?

D.S.
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
Locked Property off, but cannot select cell Steve Excel Discussion (Misc queries) 3 June 19th 14 04:29 PM
Linked Cell Property In Activex controls KG Excel Discussion (Misc queries) 4 February 26th 05 10:37 PM
Getting a handle on Userform controls Howard Kaikow Excel Programming 2 November 18th 03 04:08 PM
Hyperlinks from UserForm Controls Nigel[_5_] Excel Programming 3 November 1st 03 01:21 PM
Add controls to UserForm Vyyk Drago Excel Programming 3 August 26th 03 01:22 PM


All times are GMT +1. The time now is 05:55 AM.

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

About Us

"It's about Microsoft Excel"