A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
I wouldn't eliminate clicking the X. It's a natural choice for the user.
But you could just run the code associated with the cancel/quit button from that
event:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Call CommandButton2_Click 'or whatever button you're using
End If
End Sub
peeshepme wrote:
I have put together some code to password protect a workbook because Excel's encryption of VBA code when you password protect with Excel's built in feature causes Excel to disable my VBA code.
The problem with my UserForm, password entry form, is the X in the upper right corner of the UserForm.
By clicking on the X, one can bypass my code.
Can one eliminate the X in the upper right corner of a UserForm?
--
Dave Peterson