View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Simonds Patrick Simonds is offline
external usenet poster
 
Posts: 258
Default password protection

I was doing something similar but found that you could get around the
Password UserForm by clicking on the X on the upper right corner. It was
suggested by someone that I use the following code to keep that from
happening:

Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)
' Prevents use of the Close button
If CloseMode = vbFormControlMenu Then
MsgBox "Clicking the Close button does not work."
Cancel = True
End If
End Sub



"dominicb" wrote in
message ...

Good morning Neil Pattison

To do this you are probably better off using a textbox on a userform
and set the PasswordChar property to "*". That is certainly the easier
way.

However, if you really want to continue using an input box, Daniel
Klann has devised a way to get around the problem by using a series of
API calls to intercept and translate the key presses. See his article
he

http://www.xcelfiles.com/API_09.html

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile:
http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=472890