LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default UserForm Password

I have just inherited a spreadsheet with userform and the vba lines
below (Yes, I happen to a beginner in VBA). The problem I am having
with the userform is that once it pops up, you click on the create
template command button and the program starts. Now the problem is it
doesn't ask you to enter a password even though it has textbox and a
command button to ok this. Please help me explain how I can
incorporate a password in the vb lines below so that everytime a
correct password is entered the program is activated.

Many thanks.


Private Sub cmdCreate_Click()
frmauthorisation.Hide
Call CreateTemplate
Me.lbldone.Caption = "A total of " & iWCount & " workbooks" _
& " containing a total of " & iCCount & " worksheets created."
Me.lbldone.Visible = True
frmauthorisation.Show
End Sub

Private Sub cmdCancel_Click()
Unload frmauthorisation
End Sub

Private Sub cmdOK_Click()
If vPW = sPW Then
Me.cmdcreate.Enabled = True
Else
Me.cmdcreate.Enabled = False
MsgBox "Incorrect Authorisation Code!", vbCritical,
"Authorisation"
End If
End Sub

Private Sub Label1_Click()

End Sub
Private Sub lblDone_Click()

End Sub

Private Sub txtPW_Change()
vPW = Me.txtpw.Text
Me.cmdOk.Enabled = Len(vPW & vbNullString) 0
End Sub

Private Sub UserForm_Initialize()
sPW = Chr$(112) & Chr$(104) & Chr$(79) & Chr$(110) & Chr$(108) &
Chr$(121)
End Sub

 
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
Password Userform help !!!! K1KKKA Excel Discussion (Misc queries) 4 January 10th 07 03:09 PM
Userform Jeff Excel Discussion (Misc queries) 0 February 6th 06 09:30 PM
userform carwincarber New Users to Excel 0 October 23rd 05 06:59 PM
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. Daniel Excel Worksheet Functions 0 June 23rd 05 11:56 PM
bypass password when update linking of password protected file Yan Excel Discussion (Misc queries) 1 February 7th 05 11:29 PM


All times are GMT +1. The time now is 01:56 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"