View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Alex J Alex J is offline
external usenet poster
 
Posts: 85
Default Excel Slowing To A Crawl

Paul,
Sounds like you might have the classic limitation in Excel storage in the
TEMP directory, which has a significant impact on speed. First thing to do
is close Excel and delete all temp files (especially .emf).

Dave McRitchie has a really good treatment for everything performance
related at www.mvps.org/dmcritchie/excel/slowresp.htm. (Serach to Temporary
files on a very long web page). You should find some really intersting stuff
there.

(By the way, Dave also talks about not releasing objcets after use (Like Set
MyObject = Nothing). Could that be the source of your accumulating
slowdown?)

Another accumulating slowdown I have had to deal with is related to
iteratively adding sheets to the same workbook. Are you doing this somewhere
in the routine?

Someone (I think Debra Dalgliesh) posed a startup macro to clean the Temp
directory some time ago -
below is the copy I have used:

Hope this might get you in the right direction,
AlexJ

Private Sub DeleteEMFs()

Dim fso As Variant
On Error GoTo ERRfso
Set fso = CreateObject("Scripting.FileSystemObject")

Dim fs As FileSearch
Dim i As Long
Set fs = Application.FileSearch
With fs
.LookIn = fso.GetSpecialFolder(2)
.FileName = "*.emf"

If .Execute(SortBy:=msoSortByFileName,
SortOrder:=msoSortOrderAscending) 0 Then

On Error Resume Next
sBar ("Clearing .emf files from TEMP directory")
For i = 1 To .FoundFiles.Count
Kill .FoundFiles(i)
Next i
On Error GoTo 0
End If
sBar ("")
End With
Exit Sub
ERRfso:
Rtn = MsgBox("fso File Access Error - EMFs Cannot Be Accessed",
vbInformation + vbOKCancel, "[INIT0 - DeleteEMFs]")
Set fso = Nothing
Set fs = Nothing
End Sub





"Paul W Smith" wrote in message
...
Tony,

Thank you for taking the time to offer your comments.

I have run the process on an old and much slower machine with only 256Mb

of
RAM, while the machine with the problem apparently has 512Mb. On the

older
machine the code operates without a problem, so it looks like I have a
problem with my RAM, so your advice was invaluable.

My next question is what do I do to solve this problem? Can you offer any
further assistance? Do I need to take my PC in for repair?

Paul Smith


"Tony" wrote in message
...
From a Tech Support standpoint when my users complain that any

application
is suddenly slowed down, the first thing I do is delete all of the tmp

files
on the machine. When it comes to Excel, their complaint is generally that
EVERY Excel file opens and responds slowly. Even though you indicated that
you're running a subroutine and experiencing this in a particular

workbook,
it still may be worth it to delete all of the .tmp files from the machine.
I've seen on at least 5 seperate occasions where the .tmp's had brought
Excel to a crawl and once I deleted those, the problem cleared up
immediately.
Assumimg it's not related to your code, it could also be memory related

in
the sense that after the routine runs for so long, it begins accessing an
area of RAM that's bad (I've had this happen with other software.)

Likewise,
do you have enough memory?
To rule memory out, run the subroutine on a different PC if possible.

Although I seriously doubt it's memory related, it may be worth trying
unless you're convinced that it's somewhere in your code.

Tony