View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim[_34_] Jim[_34_] is offline
external usenet poster
 
Posts: 17
Default Password Boxes from xl95 to xl2000

I have a customised excel package in xl95 which uses the old dialog boxes
for password protection. I need to update it now to xl 2000 onwards and the
ability to
change the password, if necessary, by the user.
The old code is as below!
I'm not expecting anyone to rewrite it!!
Any ideas
Jim

<<Dim PassDialog, HiddenEB, DisplayEB
Dim PWord As String

Const Password = "manson"

Sub TillTakingsPassword()
Dim StayInLoop As Boolean
SetVariables
DisplayEB.Enabled = False 'Display box cannot be tabbed to
StayInLoop = True
While StayInLoop
HiddenEB.Text = ""
DisplayEB.Text = ""
PWord = ""
If PassDialog.Show Then
If PWord = Password Then
MsgBox "Welcome to the Masons Arms Daily Till Sheet", 4160,
"Masons Arms - Till Takings"
StayInLoop = False
TillTakingsSelect
Toolbars("Mats").Visible = True
Toolbars("Mats").Position = xlTop
Else
MsgBox "The password is not : " + PWord, 4112, "Masons
Arms - Till Takings"
End If
Else
MsgBox "Press OK to Exit", 4144, "Masons Arms - Till Takings"
StayInLoop = False
End If
Wend
End Sub

Sub MaskPassword()
PWord = HiddenEB.Text
DisplayEB.Text = String$(Len(PWord), "*")
End Sub

Sub SetVariables()
Set PassDialog = ThisWorkbook.DialogSheets("dboxTillTakingsPassword ")
Set HiddenEB = PassDialog.EditBoxes("HiddenEB")
Set DisplayEB = PassDialog.EditBoxes("DisplayEB")
End Sub
'Shows end of first password macro