Difficult to know how Nick could have given any clearer information than he
did on the basis of your OP, catered for scenarios you didn't previously
clarify, including the one you have now.
> Again, let me state that this problem does not seem to have anything to do
> with whether the Userform is Modal.
It has everything to do wither whether the forms are modal/modeless. With a
modal form the only way you could activate another workbook or run a form in
another workbook is via code in the form, say activated from a button.
For your situation with two modeless forms try running same in two workbooks
(pretty much along the lines already suggested) -
'normal module
Public gbUF1 As Boolean
Sub showFormModeless()
UserForm1.Show vbModeless
End Sub
'userform1
Private Sub UserForm_Initialize()
Me.Caption = ThisWorkbook.Name
ThisWorkbook.Activate
gbUF1 = True
End Sub
Private Sub UserForm_Terminate()
gbUF1 = False
End Sub
'thisworkbook module
Private Sub Workbook_Activate()
If gbUF1 Then UserForm1.Show vbModeless
End Sub
Private Sub Workbook_Deactivate()
If gbUF1 Then UserForm1.Hide
End Sub
Various other ways depending on what you are doing.
Regards,
Peter T
"Edward" <Edward@discussions.microsoft.com> wrote in message
news:169AC60E-A07D-4C9A-A0B4-1685592D18B9@microsoft.com...
> Again, let me state that this problem does not seem to have anything to do
> with whether the Userform is Modal.
>
> Try this:
>
> 1 - create two Excel files, call them Model 1 and Model 2
> 2 - add an userform to each UserForm1 and UserForm2
> 3 - create a simple macro in each Project to open these userforms using
the
> Show method
> 4 - set each userform to be Modaless
>
> 5 - having both workbooks Model 1 and Model 2 open, open UserForm1
> 6 - then open UserForm2
>
> Both UserForm1 and UserForm2 should show on the screen regarless of which
> Workbook you are making the active one.
>
> I don't the want this behaviour. Other programs such Access don't behave
> like this. Does anyone know how to make Excel only show UserForm1 when
Model
> 1 is the active workbook, and to only show UserForm2 when Model 2 is the
> active one.
>
> Ed
>
>
>
> "NickHK" wrote:
>
> > Edward,
> > Whilst you can have multiple workbooks open in the same instance of
Excel,
> > only one of them can be active at a time.
> > Also only one thread of code can execute at a time.
> >
> > Depending what you are trying to achieve, you hide/show userforms in
> > another's Activate/Deactivate event or in the same events for the
> > worksheets.
> > Obviously, if you are showing a userform vbModal (the default value),
you
> > cannot interact with other objects until you have hidden or unloaded
that
> > form.
> >
> > NickHK
> >
> > "Edward" <Edward@discussions.microsoft.com> wrote in message
> > news:0D238EB8-B64A-464B-B263-514321C98857@microsoft.com...
> > > I need to run two Excel applications. Each has a different name and
> > different
> > > content. The problem is that when I open a Userform in one, and I
click to
> > > select the second application, the Userform of the first application
> > > continues to show. While the Userform in one continues to be active, I
> > cannot
> > > work or open the Userforms of the other.
> > >
> > > Has anyone ever experience this issue? How do I bypass it?
> > >
> > > Note: this does not seem to have anything to do with wether the
Userform
> > is
> > > Modal or Modaless
> >
> >
> >
Bookmarks