View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default DIsabling Escape Key while dialog active

Since dialog sheet are persistent in retaining values. set it up like this

Public bFlag As Boolean
Sub showDialog()
bFlag = True
Do While bFlag
DialogSheets(1).Show
Loop
End Sub

Sub Cancel_Button()
' MsgBox "In cancel"
If ActiveDialog.CheckBoxes(1) = xlOff Then
bFlag = False
End If
End Sub

the cancel_button code is assigned to the cancel key.


If you have an init event or if you clear values in your code, use the bflag
value there to see whether to clear or not.

In the above, as long as checkbox 1 is checked, the dialog is reshown.
There is an annoying flicker, but maybe that will disuade use of the escape
key.

--
Regards,
Tom Ogilvy





<Romu wrote in message ...
No - I need it to work ith users still using XL 95. i appreciate that it
can be done in UserForms, but the solution must support xl 95.

Cheers
Romulus
"Harald Staff" wrote in message
...
Ok, the good old DialogSheets ? I doubt that it can be done after a

while
of
researching and testing. You could do it with Userforms though, is that

an
option ?
--
HTH. Best wishes Harald
Followup to newsgroup only please


"Romulus" skrev i melding
...
Thanks Folks

I think I could have been clearer in my original post.
The dialog is displayed and acts as an interface for
users to enter data onto a temporary spreadsheet. when
They're done, they click a button that transfers that
data to a master data file.

I have programmed the dialogs without the top right 'X'
button, but the "Escape" key enables users to dismiss the
dialog, and it is this I want to avoid. Is there a way
to do this?