Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default program speed problem

I have a problem with speed differences between 2 VBA programs under excel
XP Pro
The two programs do essentially the same thing up to the point where the
differences in speed occur.
The code segment is

t1=gettickCount
With newBook
.title = stock(jj) & "live analysis"
.SaveAs Filename:=resfn
End With
t2=getTickCount
I have used
Private Declare Function GetTickCount Lib "kernel32" () As Long
to time the progs and up to the start of the with block, the times are
essentially the same. (newbook is open at this stage.)
However, when I time the with block in prog1, the difference between t2 and
t1 is 0 and in prog2, the difference averages 750. Further more as the array
stock(jj) is processed, the difference in prog1 remains 0 but the
differencein prog2 increases, eg ofr jj=1 diff is 750, for jj=2, diff=1015,
for jj=3,diff= 1200 (differences are averages of several runs)
I am running the 2 programs under the ame conditions - they are the only
programs running at the time.

Can anyone tell me what might be the cause of the problem or how I may track
it down and eliminate it?
Thanks
Chris


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default program speed problem

Apologies if I have wasted anyone's time but the problem seems to have been
caused by a typo in a path to a directory.

I have corrected that and now the 2 progs run the same. Can't understand why
the wrong directory path would cause this type of behaviour tho.
Chris
"chris" wrote in message
u...
I have a problem with speed differences between 2 VBA programs under excel
XP Pro
The two programs do essentially the same thing up to the point where the
differences in speed occur.
The code segment is

t1=gettickCount
With newBook
.title = stock(jj) & "live analysis"
.SaveAs Filename:=resfn
End With
t2=getTickCount
I have used
Private Declare Function GetTickCount Lib "kernel32" () As Long
to time the progs and up to the start of the with block, the times are
essentially the same. (newbook is open at this stage.)
However, when I time the with block in prog1, the difference between t2

and
t1 is 0 and in prog2, the difference averages 750. Further more as the

array
stock(jj) is processed, the difference in prog1 remains 0 but the
differencein prog2 increases, eg ofr jj=1 diff is 750, for jj=2,

diff=1015,
for jj=3,diff= 1200 (differences are averages of several runs)
I am running the 2 programs under the ame conditions - they are the only
programs running at the time.

Can anyone tell me what might be the cause of the problem or how I may

track
it down and eliminate it?
Thanks
Chris




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
Problem sending the command to the program Robert Excel Discussion (Misc queries) 0 December 22nd 09 01:33 AM
low speed problem peyman Excel Discussion (Misc queries) 3 August 29th 07 03:42 AM
Excel 2007 Speed Problem JohnnyG Excel Discussion (Misc queries) 5 May 24th 07 04:44 PM
Can you speed UP drag speed? Ryan W Excel Discussion (Misc queries) 1 October 24th 05 06:09 PM
Problem with embedded Sheet in VB program Tom Ogilvy Excel Programming 1 August 28th 03 01:07 PM


All times are GMT +1. The time now is 04:18 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"