Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    171
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Way to temp. disable Form updates? (form equiv of 'ScreenUpdating = False')

    Hi all,

    Is there a way of temporarily disabling updates to a Windows form that I have created with VBA? BTW, I am working with Word (2003 - 2010).

    For example, I want to change the number and/or position of controls on a Windows form. So in order not to slow down the processing and that the user should not see controls appearing and disappearing I would like to temporarily disable the updates to the form while the controls are moving. After I have completed the move operations, I want to then re-enable the form updating so the the user will see all the updates in their final positions.

    I am aware of a similar display disable capability for the Word document itself: the ScreenUpdating setting, so I am looking for a 'forms equivalent' of 'ScreenUpdating = False'.

    TIA

    -avraham

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,227
    Thanks
    202
    Thanked 794 Times in 728 Posts
    Avraham,

    I can't seem to make your problem appear with a small sample problem, see attached. Your problem may lie in code you have attached to OnFocus/LostFocus events, or similiar, for the controls you are moving. You might want to try turning off events. Unfortunately, it seems you cant do this directly in a UserForm module! Here's a possible solution to that problem.
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  4. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    860
    Thanks
    0
    Thanked 10 Times in 9 Posts
    Do you .Show the form first? Try loading the form, then manipulate the controls and .Show when finished. If the form is already displayed, you could create a copy of the form (set a variable to hold the form object), and then manipulate the controls and .Show the object (copy of form) when complete. (Hide the original form first.)

  5. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,896
    Thanks
    0
    Thanked 86 Times in 82 Posts
    You can also use the LockWindowUpdate api routine to freeze the screen.
    Regards,
    Rory
    Microsoft MVP - Excel.

  6. #5
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    171
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks, everybody. I will try out the ideas.

    -avraham

Posting Permissions

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