Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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" wrote in message
...
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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default 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" wrote in message
...
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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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" wrote in message
...
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" wrote in message
...
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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Conversion issue Farias Excel Discussion (Misc queries) 6 August 1st 08 03:47 PM
Time on the X Axis Issue Dave Charts and Charting in Excel 4 March 3rd 06 05:34 PM
Excel vb running a batch files and parsing output issue Mike S[_3_] Excel Programming 0 June 8th 04 04:43 AM
Run Time Issue Steph[_3_] Excel Programming 2 May 27th 04 08:07 PM
How to become a better programmer, post college. More projects or less projects. Matt Somers Excel Programming 1 February 12th 04 01:54 PM


All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"