+ Reply to Thread
Results 1 to 11 of 11

Running 2 projects at same time issue

Hybrid View

  1. #1
    Edward
    Guest

    Running 2 projects at same time issue

    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

  2. #2
    NickHK
    Guest

    Re: Running 2 projects at same time issue

    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




  3. #3
    Edward
    Guest

    Re: Running 2 projects at same time issue

    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

    >
    >
    >


  4. #4
    Peter T
    Guest

    Re: Running 2 projects at same time issue

    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

    > >
    > >
    > >




  5. #5
    Edward
    Guest

    Re: Running 2 projects at same time issue

    Please post solutions only. Don't waste time telling me that I didn't explain
    the problem the first time.

    Ed

    "Peter T" wrote:

    > 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
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Peter T
    Guest

    Re: Running 2 projects at same time issue

    Should anyone else wish to address your issue, for their and your benefit,
    you might explain why the descriptions given both by Nick and myself were
    not relevant re use of modal forms. Also explain why the *solution* I gave
    you to cater for -

    > > > 4 - set each userform to be Modaless
    > > > and only showing one form


    didn't work or why it cannot be adapted.

    Regards,
    Peter T

    "Edward" <Edward@discussions.microsoft.com> wrote in message
    news:B7D6BDEA-FEF6-4563-88DF-7DDF7DCA6E9F@microsoft.com...
    > Please post solutions only. Don't waste time telling me that I didn't

    explain
    > the problem the first time.
    >
    > Ed
    >
    > "Peter T" wrote:
    >
    > > 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
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1