Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Andy:
Private Sub UserForm_Activate() With Application .Interactive = False .EnableCancelKey = xlDisabled End With End Sub The above code approximates a modal form, which is what I needed. I would have liked to allow the user to use the Escape key in addition to being able to click on the Cancel button, but EnableCancelKey = xlDisabled prevents me from trapping the keycode as well, so the following code does not work. Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = vbKeyEscape Then Unload Me End Sub I will try looking for a EnableCancelKey = xlErrorHandler workaround, but ideally, I would like to run my user form with ShowModal = True. Unfortunately, I havent found a way to display a progressbar control correctly in a modal userform. For the time being, this does the trick. Thank you for your suggestion. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Progressbar on userform for waiting querytable retrieving data from web | Excel Programming | |||
ProgressBar control in Userform | Excel Programming | |||
NonModal Forms and Set Focus | Excel Programming | |||
MODAL vs. NonMODAL | Excel Programming | |||
using escape key to exit a userform | Excel Programming |