#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Activate a form ?

I have a form that I use for a progress indicator. I activate the form by :

frmProgress.Show

This works fine the first time, but I want to be able to display the
progress for a second routine. I have the code all set up to handle it, but
when I hit the frmProgress.Show a second time I get this message:

Form Already Displayed - Can't show modally

I want to be able to execute the code within the form - right now I'm using
the event Private Sub UserForm_Activate(). Do I need a different event? How
can I initiate the code a second time if the form is already shown ? Thanks
for any help on this.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Activate a form ?

hi
post the code you are using.

Regards
FSt1

"dhstein" wrote:

I have a form that I use for a progress indicator. I activate the form by :

frmProgress.Show

This works fine the first time, but I want to be able to display the
progress for a second routine. I have the code all set up to handle it, but
when I hit the frmProgress.Show a second time I get this message:

Form Already Displayed - Can't show modally

I want to be able to execute the code within the form - right now I'm using
the event Private Sub UserForm_Activate(). Do I need a different event? How
can I initiate the code a second time if the form is already shown ? Thanks
for any help on this.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Activate a form ?

Private Sub UserForm_Activate()

Dim Routine As String
Dim Label As String
Dim StackPointer As Integer

' Set the width of the progress bar to 0.
Me.LabelProgress.Width = 0

StackPointer = Range("Controls!W2").Value

Routine = Range("Controls!W" & StackPointer).Value

Label = Range("Controls!W" & (StackPointer + 1)).Value

Range("Controls!W2").Value = StackPointer + 2

Me.lblRoutineName.Caption = Label
Application.Run (Routine)

Range("Controls!W2").Value = Range("Controls!W2").Value - 2

If Range("Controls!W2").Value = 3 Then
Me.Hide
End If

End Sub

"FSt1" wrote:

hi
post the code you are using.

Regards
FSt1

"dhstein" wrote:

I have a form that I use for a progress indicator. I activate the form by :

frmProgress.Show

This works fine the first time, but I want to be able to display the
progress for a second routine. I have the code all set up to handle it, but
when I hit the frmProgress.Show a second time I get this message:

Form Already Displayed - Can't show modally

I want to be able to execute the code within the form - right now I'm using
the event Private Sub UserForm_Activate(). Do I need a different event? How
can I initiate the code a second time if the form is already shown ? Thanks
for any help on this.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Activate a form ?

hi
you didn't post all the code i think. I don't see where the progress meter
is being updated. seems to be another sub called routine.
so i am guessing.
i don't see where you close the form but i do see this........
If Range("Controls!W2").Value = 3 Then
Me.Hide
End If

what do you doing when the progress bar is done. here you are only hiding
it, not unloading it. this may be your problems. when you try to show a
hidden form, it is already loaded which i think is generating your error.
maybe you just need to unhide it.

Regards
FSt1



"dhstein" wrote:

Private Sub UserForm_Activate()

Dim Routine As String
Dim Label As String
Dim StackPointer As Integer

' Set the width of the progress bar to 0.
Me.LabelProgress.Width = 0

StackPointer = Range("Controls!W2").Value

Routine = Range("Controls!W" & StackPointer).Value

Label = Range("Controls!W" & (StackPointer + 1)).Value

Range("Controls!W2").Value = StackPointer + 2

Me.lblRoutineName.Caption = Label
Application.Run (Routine)

Range("Controls!W2").Value = Range("Controls!W2").Value - 2

If Range("Controls!W2").Value = 3 Then
Me.Hide
End If

End Sub

"FSt1" wrote:

hi
post the code you are using.

Regards
FSt1

"dhstein" wrote:

I have a form that I use for a progress indicator. I activate the form by :

frmProgress.Show

This works fine the first time, but I want to be able to display the
progress for a second routine. I have the code all set up to handle it, but
when I hit the frmProgress.Show a second time I get this message:

Form Already Displayed - Can't show modally

I want to be able to execute the code within the form - right now I'm using
the event Private Sub UserForm_Activate(). Do I need a different event? How
can I initiate the code a second time if the form is already shown ? Thanks
for any help on this.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Activate a form ?

Thanks for the reply. You may be right - and I'd like to try some things.
What are the methods available ? .Show .Hide .Load .Unload - what
other ones that I might try? Thanks.

David


"FSt1" wrote:

hi
you didn't post all the code i think. I don't see where the progress meter
is being updated. seems to be another sub called routine.
so i am guessing.
i don't see where you close the form but i do see this........
If Range("Controls!W2").Value = 3 Then
Me.Hide
End If

what do you doing when the progress bar is done. here you are only hiding
it, not unloading it. this may be your problems. when you try to show a
hidden form, it is already loaded which i think is generating your error.
maybe you just need to unhide it.

Regards
FSt1



"dhstein" wrote:

Private Sub UserForm_Activate()

Dim Routine As String
Dim Label As String
Dim StackPointer As Integer

' Set the width of the progress bar to 0.
Me.LabelProgress.Width = 0

StackPointer = Range("Controls!W2").Value

Routine = Range("Controls!W" & StackPointer).Value

Label = Range("Controls!W" & (StackPointer + 1)).Value

Range("Controls!W2").Value = StackPointer + 2

Me.lblRoutineName.Caption = Label
Application.Run (Routine)

Range("Controls!W2").Value = Range("Controls!W2").Value - 2

If Range("Controls!W2").Value = 3 Then
Me.Hide
End If

End Sub

"FSt1" wrote:

hi
post the code you are using.

Regards
FSt1

"dhstein" wrote:

I have a form that I use for a progress indicator. I activate the form by :

frmProgress.Show

This works fine the first time, but I want to be able to display the
progress for a second routine. I have the code all set up to handle it, but
when I hit the frmProgress.Show a second time I get this message:

Form Already Displayed - Can't show modally

I want to be able to execute the code within the form - right now I'm using
the event Private Sub UserForm_Activate(). Do I need a different event? How
can I initiate the code a second time if the form is already shown ? Thanks
for any help on this.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Activate a form ?

Thanks for your help - I found the answer ... frmProgress.Show vbModeless

"FSt1" wrote:

hi
you didn't post all the code i think. I don't see where the progress meter
is being updated. seems to be another sub called routine.
so i am guessing.
i don't see where you close the form but i do see this........
If Range("Controls!W2").Value = 3 Then
Me.Hide
End If

what do you doing when the progress bar is done. here you are only hiding
it, not unloading it. this may be your problems. when you try to show a
hidden form, it is already loaded which i think is generating your error.
maybe you just need to unhide it.

Regards
FSt1



"dhstein" wrote:

Private Sub UserForm_Activate()

Dim Routine As String
Dim Label As String
Dim StackPointer As Integer

' Set the width of the progress bar to 0.
Me.LabelProgress.Width = 0

StackPointer = Range("Controls!W2").Value

Routine = Range("Controls!W" & StackPointer).Value

Label = Range("Controls!W" & (StackPointer + 1)).Value

Range("Controls!W2").Value = StackPointer + 2

Me.lblRoutineName.Caption = Label
Application.Run (Routine)

Range("Controls!W2").Value = Range("Controls!W2").Value - 2

If Range("Controls!W2").Value = 3 Then
Me.Hide
End If

End Sub

"FSt1" wrote:

hi
post the code you are using.

Regards
FSt1

"dhstein" wrote:

I have a form that I use for a progress indicator. I activate the form by :

frmProgress.Show

This works fine the first time, but I want to be able to display the
progress for a second routine. I have the code all set up to handle it, but
when I hit the frmProgress.Show a second time I get this message:

Form Already Displayed - Can't show modally

I want to be able to execute the code within the form - right now I'm using
the event Private Sub UserForm_Activate(). Do I need a different event? How
can I initiate the code a second time if the form is already shown ? Thanks
for any help on this.

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
excel form. Need data extracted to spreadsheet each time a form co MikeR-Oz Excel Discussion (Misc queries) 4 April 5th 09 05:18 AM
Using a template form, advance a form number everytime you open ShoDan Excel Discussion (Misc queries) 1 January 31st 08 01:34 PM
Form. to ignore cells w/o value from calc from previous Form. Michele Excel Worksheet Functions 2 October 30th 07 02:40 PM
Can a form made in Excel 2002 be converted into a fillable form? Paraclete Excel Discussion (Misc queries) 1 February 20th 07 09:20 PM
how can I make a form number change everytime the form is opened babydumplingspita Excel Worksheet Functions 1 October 10th 05 07:58 PM


All times are GMT +1. The time now is 02:45 AM.

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

About Us

"It's about Microsoft Excel"