View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
dhstein dhstein is offline
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.