|
-
Apr 18th, 2007, 09:33 AM
#1
Thread Starter
Member
[Resolved] Excel is hitting a speed bump
When I first open my database and run it my macro it takes about a minute to run. If I try to rerun this Macro it takes 15 minutes. If I close the Workbook and open it back up it only takes 1 minute again. I am using large Static Arrays, but I use the Erase command to erase these Arrays. Does anyone have any idea why there would be this much slowdown?
Last edited by brellis1; Apr 19th, 2007 at 02:26 PM.
-
Apr 18th, 2007, 12:38 PM
#2
Re: Excel is hitting a speed bump
Not very easy to determine without seeing the code and knowing what its doing.
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Apr 18th, 2007, 01:03 PM
#3
Thread Starter
Member
Re: Excel is hitting a speed bump
I think I solved it. My problem was I wasn't turning the screen updating off and then on.
Application.ScreenUpdating = False
code
Application.ScreenUpdating = True
Thanks for the help
-
Apr 18th, 2007, 01:15 PM
#4
Re: Excel is hitting a speed bump
But ScreenUpdating is a performance saver. Were you clicking the button multiple times during the initial macro run or ?
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Apr 18th, 2007, 01:56 PM
#5
Thread Starter
Member
Re: Excel is hitting a speed bump
No I was just running my macro like usual (1 click). The problem was it was trying to always update the text on screen. When I implemented that the screen didn't try to update till the end. Plus my biggest problem is I haven't gotten a handle on all the internal functions in VBA. I am sure their is a search function, but I could never find it and just used a for loop with my array. Thanks for your help
Last edited by brellis1; Apr 18th, 2007 at 01:59 PM.
-
Apr 18th, 2007, 02:43 PM
#6
Re: Excel is hitting a speed bump
Oh I see. Yes there is a search function. Its called the Find method. Works off of a Range object. No looping and faster.
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|