View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default slow .Clear in 2007

The solution is Enablevents

Application.EnableEvents=False
Range("Sheet2!C10:C40000").Clear
Application.EnableEvents=True

It happens with both Clear and delete

This slowdown seems to have been caused by some very recent Microsoft
Update, it happens with all XL versions except XL97 if the system has all
the most recent updates.

Charles
_________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

"brzak" wrote in message
...
Is anybody else experiencing huge delys with the the .Clear method?
and more importantly, are there any magical tips for it?

Let's take an example: Range("Sheet2!C10:C40000").Clear

takes 1minute 54 seconds(yes, i timed it with a stopwatch). This is an
average of 3 trials, each of which took a similar amount of time.

True this is running on a laptop with a Centrino Duo (2x 1.06 GHz
processors) and with excel only ever using one of these, it doesn't
help.

The same code on a laptop running excel 2003 (single 1.3 GHz
processor) is almost instant, a few seconds at most.

I don't really expect anybody to come up with something to solve this,
but rather to tell me that there is a problem with excel?