Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    UserForm screen updating (2000)

    I have an addin with a lengthy Auto-Open sub that opens the main xl file.
    In order to display something quickly, I divided the Auto_Open into two subs:
    the first ends with UserForm1.Show

    The UserForm contains textboxes, an Open Button and a Cancel button.
    When the user clicks the Open button, I want to immediately display a
    new textbox (Textbox6, in the following code) with a short msg something
    like: "Opening... One moment, please"

    For some reason, this does NOT display until part 2 of the opening code (Open2) has completed.
    It's like I had entered at the beginning of the OpenBtn_click event
    an "Application.ScreenUpdating = False". Hence, on clicking the Open button,
    there is a 8- second delay. Then Textbox6 displays for a fraction of a second,
    followed immediately by Worksheet1.

    I also tried hiding Userform1 and showing a 2nd userform with the "Opening" msg....same result.
    How do I get a quick display of my msg?


    <pre>Private Sub CancelBtn_Click()
    Unload Me
    Application.Quit
    End Sub

    Private Sub OpenBtn_Click()
    Me.TextBox6.Visible = True
    Call Open2
    Unload Me
    End Sub



    Private Sub UserForm_Initialize()
    Me.TextBox1.Left = (Application.UsableWidth - Me.TextBox1.Width) / 2
    Me.TextBox2.Left = (Application.UsableWidth - Me.TextBox2.Width) / 2
    Me.TextBox3.Left = (Application.UsableWidth - Me.TextBox3.Width) / 2
    Me.TextBox5.Left = (Application.UsableWidth - Me.TextBox5.Width) / 2
    Me.TextBox6.Left = (Application.UsableWidth - Me.TextBox6.Width) / 2
    Me.TextBox6.Visible = False
    Me.OpenBtn.SetFocus
    End Sub</pre>


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: UserForm screen updating (2000)

    Try inserting a line

    Me.Repaint

    between the line that makes TextBox6 visible and the line that calls Open2.

  3. #3
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: UserForm screen updating (2000)

    Works great.
    thanks Hans

Posting Permissions

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