vba excel macros become very slow after the latest update
文章推薦指數: 80 %
I have a vba macro that opens an excel file, reads some data, does some calculations and closes that file and then opens another file from the ... Home Anonymous Signintopost Post Explore Tags Questions Sitefeedback Articles Users Skiptomaincontent Findthreads,tags,andusers... SearchSearch Explore Tags Questions Sitefeedback Articles Users Signintopost Home question Clicktovote 1Vote"1 Clicktodownvote AmirBahrami-0136 asked • Feb6,'22 | DusanDjurdjevic commented • Mar7,'22 vbaexcelmacrosbecomeveryslowafterthelatestupdate HiIhaveavbamacrothatopensanexcelfile,readssomedata,doessomecalculationsandclosesthatfileandthenopensanotherfilefromthelist.Iusedthismacrobeforethelatestupdatewithlistsupto50files,eachbeingoforderof10MB.Thespeedwasacceptable.Afterthelatesofficeupgrade,thismacrohasbecomeveryslow,evenwithmuchshorterlistsandsmallerinputfiles.Checkingontaskmanager,Inoticedthatthememorytakenbyexcelencreaseswitheachfileopening,butnotreleasedwhenthefileisclosed.Itsumsuptoabout3.5GBandstopstheremakingitveryslow.Itriedafewoptions,disabledhardwaregraphicacceleration,ignoredotherapplicationsthatuseDynamicDataExchange(DDE)andcleanedthe.tempfolderinmyCdrives.Nothingseemedtohelp.Pleaseadvise. office-vba-dev Comment Comment· Show 3 Comment 5|1600charactersneededcharactersleftcharactersexceeded ▼ Visibletoallusers Visibletotheoriginalposter&Microsoft Viewablebymoderators Viewablebymoderatorsandtheoriginalposter Advancedvisibility ToggleCommentvisibility.CurrentVisibility:Visibletoallusers Attachments:Upto10attachments(includingimages)canbeusedwithamaximumof3.0MiBeachand30.0MiBtotal. ShawnG-3174 ·Feb16at06:58PM Iamalsoexperiencingthesimilarproblem.Themacroslowsdownwithuseordurationofthefilebeingopen.Filesizeis17MB.Ihavetheusualspeedenhancementof: 'SpeedenhancementsApplication.PrintCommunication=FalseApplication.DisplayStatusBar=FalseApplication.ScreenUpdating=FalseApplication.Calculation=xlCalculationManualApplication.EnableEvents=False TheonlyworkaroundIhavecomewithistoconstantlyrestartexcelbeforeexecutingthemacro. Curioustoheartheresponse. 1Vote1 · Aafra-7698 ShawnG-3174 ·Feb17at10:43PM Ihadexactlythesameproblems.Thelatestupdate14827.20198seemstosolvealleissues.Thankyouverymuch 1Vote1 · DusanDjurdjevic ·Mar07at01:21PM IhavenoticedmajorslowdownofmyVBAMacrosinthelastfewmonthsandinsomecasesXLfilesareabruptlyclosedforlongerrunningmacros.TodayIhavefoundonhttps://techcommunity.microsoft.com/t5/excel/excel-macro-runs-painfully-slow/m-p/2772538/page/2theactualsolutionthatleadtospeedimprovement-addingthefolderwithexcelfileintoTrustedLocations. Oncethefolderisintrustedlocations,Macrosstartedtobeexecutedin"fastmode". Hopethatthiscanbehelpfultoothers. 0Votes0 · image.png (63.9KiB) 2Answers SortbyCreatedCreated SortbyOldestOldest SortbyVotesVotes Clicktovote 0Votes"0 Clicktodownvote AmirBahrami-0136 answered • Feb17,'22 | Aafra-7698 commented • Feb18,'22 HiAafraThanksforthesuggestedworkaround.However,inmycase,themacroopensandreadsalistofexcelfilesso,Iwon'tbeabletocloseandrestartexceleverytime.ThisisanewproblemwithhowexcelhandlesRAMmemory.Aparently,itwon'treleasethepartofmemorythatisnotneededafterafileisclosed,orsomethinglikethat! Comment Comment· Show 1 Comment 5|1600charactersneededcharactersleftcharactersexceeded ▼ Visibletoallusers Visibletotheoriginalposter&Microsoft Viewablebymoderators Viewablebymoderatorsandtheoriginalposter Advancedvisibility ToggleCommentvisibility.CurrentVisibility:Visibletoallusers Attachments:Upto10attachments(includingimages)canbeusedwithamaximumof3.0MiBeachand30.0MiBtotal. Aafra-7698 ·Feb18at11:05AM HiAmirBahrami,Thisproblemhasbeenreportedtwice(problemofSivanSivaprakash-256)Thesuggestedworkaroundofrestartingexcelwasmentionedthere.Myproblemwassolvedwhenupdate16.0.14827.20198wasinstalled.Hopefullyitworksforyoutoo 0Votes0 · Clicktovote 0Votes"0 Clicktodownvote AmirBahrami-0136 answered • Feb20,'22 HiIhavejustnoticedthatthiswasduetousingworksheetfunctionsinmycode.AssoonasIremovedthem,theRAMbeingoccupiedbydatadissapeared. Comment Comment Show 0 Comment 5|1600charactersneededcharactersleftcharactersexceeded ▼ Visibletoallusers Visibletotheoriginalposter&Microsoft Viewablebymoderators Viewablebymoderatorsandtheoriginalposter Advancedvisibility ToggleCommentvisibility.CurrentVisibility:Visibletoallusers Attachments:Upto10attachments(includingimages)canbeusedwithamaximumof3.0MiBeachand30.0MiBtotal. questiondetails 6peoplearefollowingthisquestion. AnswersSubscribetoAnswers AnswersandCommentsSubscribetoCommentsandAnswers RelatedQuestions macrosforinsertingmultiplephotosinword ProblemwithMicrosoft.Office.Interop.Excel IwouldliketousetheXORcapabilitiestoencrypt/decryptapasswordforAzureSQLServer HowtodifferentiatebetweenMSI,PUBfilevsDOC/XLS/PPTfiles IssuewithLinkFormat.SourceFullNamePropertyset About · FAQ · Privacy · Copyright©2010-22DZone,Inc.
延伸文章資訊
- 1Why is my Excel macro slow when think-cell is activated?
A common problem that can cause performance issues in VBA macros is the usage of the .Select func...
- 2Excel VBA Speed And Efficiency - SOA.org
This article is primarily focused on Excel VBA macros, however many of these ... they can be nume...
- 3Is Your Excel VBA Running SLOW? Here are 6 Tips to ...
5 tips for writing faster VBA code · 1. Learn functional computer programming · 2. Turn off unnee...
- 4vba excel macros become very slow after the latest update
I have a vba macro that opens an excel file, reads some data, does some calculations and closes t...
- 5Slow VBA Macro | MrExcel Message Board
I've made a macro in vba which is taking quite a bit of time to run (approx 70 secs) and was wond...