+ Reply to Thread
Results 1 to 8 of 8

Excel takes forever to react again after closing userform

  1. #1
    Registered User
    Join Date
    12-09-2015
    Location
    Netherlands
    MS-Off Ver
    Office 2010 / 2013
    Posts
    9

    Question Excel takes forever to react again after closing userform

    I have a button that closes the userform, named "Annuleren". Whenever this is clicked, the userform closes and excel kind of freezes for a time (10+ seconds).
    I don't think the code is that complicated, but for some reason it causes a complete meltdown.

    below the code for the sub that hides the userform, the one for Userform_Terminate is roughly the same.

    Please Login or Register  to view this content.
    the file contains 1 userform and 43 sheets.
    I've tried keeping out .Select and/or the protection on the sheets, but it still takes forever.
    The code is fairly large, but in a comparable file this works much more smoothly...
    Am i missing something?

  2. #2
    Forum Contributor
    Join Date
    05-08-2015
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2013, 2016, Mac 2016
    Posts
    629

    Re: Excel takes forever to react again after closing userform

    Mathljs

    Have you tried
    Please Login or Register  to view this content.
    at the end?
    Have a great day!

    u3rick

  3. #3
    Registered User
    Join Date
    12-09-2015
    Location
    Netherlands
    MS-Off Ver
    Office 2010 / 2013
    Posts
    9

    Re: Excel takes forever to react again after closing userform

    Hi Rick,

    thank you for your reply. I initially tried to work with Unload me, but that also didn't help.
    It was still slow. I just tried it again and no difference in time...

  4. #4
    Forum Contributor
    Join Date
    05-08-2015
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2013, 2016, Mac 2016
    Posts
    629

    Re: Excel takes forever to react again after closing userform

    Mathijs3

    I am pretty new to VBA, but it might be that it is checking the 43 sheets for something before closing. I know that always slows my stuff down. Sorry I don't have the answer!

    I am sure that someone will help you soon!

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Excel takes forever to react again after closing userform

    Can you post the code that's closing the userform?
    If posting code please use code tags, see here.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Excel takes forever to react again after closing userform

    Mathijs3,

    Is it equally slow if you just close the userform via the X at the top? i.e. when only the Terminate event fires, and not the code for your cancel button.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  7. #7
    Registered User
    Join Date
    12-09-2015
    Location
    Netherlands
    MS-Off Ver
    Office 2010 / 2013
    Posts
    9

    Re: Excel takes forever to react again after closing userform

    @ Norie, the code is above in the first post, although I use 'Unload Me' instead of of 'Hide'. Hide was a test to see if that would speed it up.

    @ Arkadi, yes, it doesn't make a difference at all.

    I think i found the reason why it is so slow, it's probably because it has to update roughly 220 pivot tables..
    I'll try to find out if i can do it with less tables to see if that speeds things up.
    I assume that will work.. Sorry for wasting your time, appreciate it a lot though!

    Edit: I'll put the post on solved as soon as i tried this

  8. #8
    Registered User
    Join Date
    12-09-2015
    Location
    Netherlands
    MS-Off Ver
    Office 2010 / 2013
    Posts
    9

    Re: Excel takes forever to react again after closing userform

    it was the amount of pivot tables that slowed it down this much. Topic solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro takes forever after upgrading from excel 20007 to 2010
    By Yigal in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-05-2014, 10:45 AM
  2. VBA that hides rows with 0 takes FOREVER to run
    By Sky188 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-28-2013, 04:04 PM
  3. Excel Sheet takes forever to save
    By JohnGault82 in forum Excel General
    Replies: 2
    Last Post: 02-09-2011, 04:41 PM
  4. Copying column w/ VBA takes forever
    By patatvs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2010, 01:42 PM
  5. Excel 2007 takes forever to export Data
    By JF_Sly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2008, 01:44 PM
  6. [SOLVED] Excel Moving sheet between workbooks takes forever on some workstations
    By John M. Mach, MOUS Master, MCSC in forum Excel General
    Replies: 5
    Last Post: 11-18-2005, 12:15 AM
  7. Workbook takes forever to open
    By drgreig in forum Excel General
    Replies: 4
    Last Post: 08-11-2005, 03:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1