Results 1 to 5 of 5

Thread: i've heard that you can freeze screen while running macro to gain time

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Location
    france
    Posts
    71

    Resolved i've heard that you can freeze screen while running macro to gain time

    but i don't know how to do
    Last edited by writelearner; May 3rd, 2005 at 12:40 AM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: i've heard that you can freeze screen while running macro to gain time

    I think its only in Excel, but here is how you do it.
    VB Code:
    1. 'To turn off updating to gain speed.
    2. Application.ScreenUpdating = False
    3. 'To turn it back on.
    4. Application.ScreenUpdating = True
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: i've heard that you can freeze screen while running macro to gain time

    as RobDogg said, the screenUpdating is the way to go, but is Excel only.

    i use this, but at the end of the loop i enable it to let the user see that the spreadsheet is actually doing something as if you have a long loop, the user sometimes thinks its crashed and will quit the app.

    so at the beginning of the time consuming loop, disable, and at the end of the loop enable, thus giving an intermittent update of the screen.

    HTH
    if you fail to plan, you plan to fail

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Location
    france
    Posts
    71

    Re: i've heard that you can freeze screen while running macro to gain time

    thanks

  5. #5
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: i've heard that you can freeze screen while running macro to gain time

    If you are using a userform, you can update a label caption with info like percentage complete, which you only need to update every three seconds. This lets the user see that the app is doing something. If you decide to do this, use DoEvents after updating the caption, or the window will not refresh.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

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



Click Here to Expand Forum to Full Width