Thread: Modal User Form
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Modal User Form

Jim,

You are using the wrong constant. The two constants for the modality of
forms are vbModal and vbModeless. The value of vbModeless and the value of
vbApplicationModal are the same, so your code is showing the form
modelessly.

Change vbApplicationModal to vbModal.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Jim M" wrote in message
...
I am trying to design a user form to function as a "Accept
our Terms" form the first time someone opens the file. I
have the ShowModal Property of the form set to True and
use the following code to load the form:

Sub Auto_Open()

If NotAccepted Then frmAgree.Show (vbApplicationModal)

The form loads OK but you can then click on the underlying
worksheet and work normally with the user form still
open. Shouldn't this force the user form to have to be
closed before the worksheet can be accessed?

Thanks
Jim