View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
k1sr k1sr is offline
external usenet poster
 
Posts: 12
Default vbApplication-NOT-Modal

THanks Rick,

I'm not sure that that's what I'm after...

Say I've got 2 workbooks open - WBK1 and WBK2

In WBK1 I do somethin to bring up a message box or user form, I want WBK1 to
remain modal, whereas WBK2 is modeless...

In short, access to WBK1 is blocked, however the user can access WBK2

Cheers

"Rick Rothstein (MVP - VB)" wrote:

You could use this Workbook_SheetActivate code as a guide. First, it hides
the UserForm and then, depending on which worksheet is selected, it shows
the UserForm as either modal or modeless.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
UserForm1.Hide
If Sh.Name = "Sheet1" Then
UserForm1.Show
Else
UserForm1.Show vbModeless
End If
End Sub

By expanding this into an If-ElseIf-Else-EndIf structure, you can even
choose not to show the UserForm for some sheets, show it modal for others
and show it modeless for still others.

Rick


"k1sr" wrote in message
...
Thanks guys...

Is there any way to keep that worksheet modal, such that the application
and
other workbooks/worksheets are freed up and can be used but the initial
worksheet cannot...

Maybe I just want too much...

Cheers