ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA - Forms Exit Errors (https://www.excelbanter.com/excel-programming/302975-vba-forms-exit-errors.html)

jordanctc[_5_]

VBA - Forms Exit Errors
 
I made a real whizbang form with a lot of enabling and disabling wit
shifting focus based on user input.

The problem is the setfocus in the form blows up when the user hit th
X to exit out of the window.

Is there a way to disable the X and just make them finish the form?

I like having forms that take the errors out and save steps by shiftin
focus - I'd _really_ hate to lose all of that. So any answers o
advise??

Thanks,
Jorda

--
Message posted from http://www.ExcelForum.com


Charles

VBA - Forms Exit Errors
 
jordanctc

This should prevent the user fron using the "X".



Private Sub userform_QueryClose(Cancel As Integer, CloseMode A
Integer)
Application.ScreenUpdating = False
If CloseMode = vbFormControlMenu Then
MsgBox "You Have to use the Exit Button to close!"
Cancel = True
End If
End Sub


HTH

Charle

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com