Forum Discussion
bruce carskadon
Jul 21, 2018Copper Contributor
slow after running macro
I run a macro in excel using VB. It runs extremely slow. Once the program ends, the workbook is very slow to respond in normal worksheet movements. if I close the program and reopen, it responds n...
JMB17
Feb 26, 2021Bronze Contributor
From what I see, it should only be running on the range that is given to it.
wpk467
Feb 22, 2022Copper Contributor
Hi all
I don't know if this thread is still open but in the last week 2, when a long macro that I run to simulate football matches finishes, Excel becomes very slow; when I type, it takes about a minute or two to be able to do so. When I restart Excel, it all works fine. Similar to the original post.
Strange thing is, I ran the same macro from a backup file from 2 years ago and same problem occurs, whereas back then, it would complete fine. The only things that have changed for me are Windows 11.
I use the same techniques such as disabling conditional formatting and screen updating, so not sure what else I should be optimising something that wasn't broken before. Is there some sort of caching that Excel builds up when it runs macro and can only be cleared after a restart?
I don't know if this thread is still open but in the last week 2, when a long macro that I run to simulate football matches finishes, Excel becomes very slow; when I type, it takes about a minute or two to be able to do so. When I restart Excel, it all works fine. Similar to the original post.
Strange thing is, I ran the same macro from a backup file from 2 years ago and same problem occurs, whereas back then, it would complete fine. The only things that have changed for me are Windows 11.
I use the same techniques such as disabling conditional formatting and screen updating, so not sure what else I should be optimising something that wasn't broken before. Is there some sort of caching that Excel builds up when it runs macro and can only be cleared after a restart?
- wpk467Feb 23, 2022Copper ContributorI did suspect that, glad I'm not the only one.
Thanks v much for the links, I'll review at my next opportunity - JMB17Feb 22, 2022Bronze ContributorThere are some other users that have experienced the same thing. It appears it could be due to a recent update/patch Microsoft pushed:
https://techcommunity.microsoft.com/t5/excel/macros-suddenly-run-much-slower/m-p/3136265
https://techcommunity.microsoft.com/t5/excel/excel-macro-runs-painfully-slow/m-p/3180940/emcs_t/S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufEtaUkRaNzhDWjVIRTZEfDMxODA5NDB8U1VCU0NSSVBUSU9OU3xoSw#M134966
One of the commenters, in the second link, believes it may be related to 'trusted locations' and was able to improve performance by adding the directory in which the workbook was located to trusted locations.
I and other users in my organization have recently experienced the same thing (file with auto open macro takes eternity to open), but moving the file to the machines local D drive fixed it (and it's not a network speed issue). So, whatever MS did, it appears to be related to the file's location.