View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default X button on userforms

Careful, this will stop you ever closing the form. You need to allow some
function to close it, such as a code triggered close,

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode < vbFormCode Then
Cancel = True
End If
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"OJ" wrote in message
ups.com...
Hi Greg, look up QueryClose in VBA Help but this will disable the
X.....

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
Cancel = True
End Sub

Hth,
OJ