Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default breakpoint affecting the run speed of a macro

Hi,

I have a macro that seems to be running slowly when left to its own
devices. I did some testing to figure out which particular part of the
macro was being slow (a part that loops through an array and writes
data to a worksheet). If I put a breakpoint immediately before the slow
part then hit F5 to continue execution, it runs much faster (2 secs
versus 30 secs without the breakpoint). This makes no sense to me. Can
someone please explain what precisely is happening here?

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default breakpoint affecting the run speed of a macro

Probably got its second wind.

"kebabb" wrote:

Hi,

I have a macro that seems to be running slowly when left to its own
devices. I did some testing to figure out which particular part of the
macro was being slow (a part that loops through an array and writes
data to a worksheet). If I put a breakpoint immediately before the slow
part then hit F5 to continue execution, it runs much faster (2 secs
versus 30 secs without the breakpoint). This makes no sense to me. Can
someone please explain what precisely is happening here?

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default breakpoint affecting the run speed of a macro

Just a guess... try adding "DoEvents" (no quote marks) on its own
line at the place where you had entered the break point.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"kebabb"

wrote in message
Hi,
I have a macro that seems to be running slowly when left to its own
devices. I did some testing to figure out which particular part of the
macro was being slow (a part that loops through an array and writes
data to a worksheet). If I put a breakpoint immediately before the slow
part then hit F5 to continue execution, it runs much faster (2 secs
versus 30 secs without the breakpoint). This makes no sense to me. Can
someone please explain what precisely is happening here?
Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default breakpoint affecting the run speed of a macro

i seen significant speed differences when running code after opening the vbe.
even if i close it, code runs slower. but if i quit , restart excel and then run
the code, it is fast again. open and close the code editor, it slows down.

--

Gary

"kebabb" wrote in message
ps.com...
Hi,

I have a macro that seems to be running slowly when left to its own
devices. I did some testing to figure out which particular part of the
macro was being slow (a part that loops through an array and writes
data to a worksheet). If I put a breakpoint immediately before the slow
part then hit F5 to continue execution, it runs much faster (2 secs
versus 30 secs without the breakpoint). This makes no sense to me. Can
someone please explain what precisely is happening here?

Thanks!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Range Name affecting speed of macro Richard Buttrey Excel Worksheet Functions 5 May 1st 06 03:06 PM
Range Name affecting speed of macro Richard Buttrey Excel Programming 6 May 1st 06 03:06 PM
Macro affecting hyperion retreive Jim May Excel Programming 0 April 5th 06 01:06 PM
Breakpoint ok, no breakpoint messes up... Vikxcel[_8_] Excel Programming 0 January 4th 06 09:18 PM
sumproduct, arrays affecting speed Dave Breitenbach Excel Worksheet Functions 4 December 1st 05 11:16 PM


All times are GMT +1. The time now is 04:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"