Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem sending the command to the program | Excel Discussion (Misc queries) | |||
low speed problem | Excel Discussion (Misc queries) | |||
Excel 2007 Speed Problem | Excel Discussion (Misc queries) | |||
Can you speed UP drag speed? | Excel Discussion (Misc queries) | |||
Problem with embedded Sheet in VB program | Excel Programming |