Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default User form- protection and password.

How to protect a userform (code + object) by assigning a password?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default User form- protection and password.

Hi Tungana,

===========
How to protect a userform (code + object) by assigning a
password?===========

Try password protecting the VBA project:

In the VBE,

Menus | Tools | VBAProject Properties | Protection |
Lock Project for viewing [x] |
Enter and confirm Password | OK
Save, close and re-open the file.



---
Regards.
Norman

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default User form- protection and password.

I follwed your instruction ,the user form is still opening after clicking the
Rectangle to which I assignined the user form code

"Norman Jones" wrote:

Hi Tungana,

===========
How to protect a userform (code + object) by assigning a
password?===========

Try password protecting the VBA project:

In the VBE,

Menus | Tools | VBAProject Properties | Protection |
Lock Project for viewing [x] |
Enter and confirm Password | OK
Save, close and re-open the file.



---
Regards.
Norman


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default User form- protection and password.

Hi Tungana,

I misunderstood; I assumed that you wished
to prevent access to the Userform module.

Try assigning something like the following
code to your rectangle:

'==========
Sub Rectangle1_Click()
Dim Res As String
Const PWORD As String = "ABC" '<<==== CHANGE

Res = InputBox(Prompt:="Enter password")

If Res < PWORD Then
MsgBox Prompt:="The password has not " _
& "been recognised!", _
Buttons:=vbCritical, _
Title:="Password"
Exit Sub
End If

'Your code to open theUserform, e.g.:
Userform1 , Show

End Sub
'<<==========



---
Regards.
Norman


"TUNGANA KURMA RAJU" wrote in
message ...
I follwed your instruction ,the user form is still opening after clicking
the
Rectangle to which I assignined the user form code

"Norman Jones" wrote:

Hi Tungana,

===========
How to protect a userform (code + object) by assigning a
password?===========

Try password protecting the VBA project:

In the VBE,

Menus | Tools | VBAProject Properties | Protection |
Lock Project for viewing [x] |
Enter and confirm Password | OK
Save, close and re-open the file.



---
Regards.
Norman



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default User form- protection and password.

Thank you,Norman Jones,Its working !!!

"Norman Jones" wrote:

Hi Tungana,

I misunderstood; I assumed that you wished
to prevent access to the Userform module.

Try assigning something like the following
code to your rectangle:

'==========
Sub Rectangle1_Click()
Dim Res As String
Const PWORD As String = "ABC" '<<==== CHANGE

Res = InputBox(Prompt:="Enter password")

If Res < PWORD Then
MsgBox Prompt:="The password has not " _
& "been recognised!", _
Buttons:=vbCritical, _
Title:="Password"
Exit Sub
End If

'Your code to open theUserform, e.g.:
Userform1 , Show

End Sub
'<<==========



---
Regards.
Norman


"TUNGANA KURMA RAJU" wrote in
message ...
I follwed your instruction ,the user form is still opening after clicking
the
Rectangle to which I assignined the user form code

"Norman Jones" wrote:

Hi Tungana,

===========
How to protect a userform (code + object) by assigning a
password?===========

Try password protecting the VBA project:

In the VBE,

Menus | Tools | VBAProject Properties | Protection |
Lock Project for viewing [x] |
Enter and confirm Password | OK
Save, close and re-open the file.



---
Regards.
Norman



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 Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Date field in user form & Loading a user form on opening workbook Balan Excel Programming 1 May 24th 08 03:40 PM
Password protection excel document - last user setting lost Jon's problem Excel Discussion (Misc queries) 0 October 23rd 07 11:52 PM
Protection password iin VBA, how to avoid user seeing it? Afsha Excel Discussion (Misc queries) 2 January 23rd 07 03:06 PM
Password protection for an individual form Mort_Komabt[_2_] Excel Programming 2 December 20th 05 09:30 PM


All times are GMT +1. The time now is 08:50 PM.

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"