View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Calculate on Status Bar causing VBA to run very slow

Hi Darren,

You could do something like this to see if it helps:

Sub demo()
Dim lCalcMode As Long

With Application
lCalcMode = .Calculation
.Calculation = xlCalculationManual
.Calculate
End With

'/ do your stuff here

With Application
.Calculate
.Calculation = lCalcMode
End With
End Sub


Lots more details on calculation available he

http://www.decisionmodels.com/calcsecretsh.htm


--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Darren Elsom wrote:
I have a workbook which has exceeded Excels limit of 65,536
dependencies. Consequently I have the 'Calculate' message on the
status bar. This does not pose any problems. However, if the user
executes some VBA code, the length of time time taken to execute can
be several minutes for code that can normally executes in seconds.

Is there a way to force a recalc (F9 or alt+ctrl+F9) and then
instruct VBA to execute procedures without being slowed down by Excel?

Or have I interpreted incorrectly what Excel/VBA is doing?

Any help will be greatly appreciated.

Kind regards,

Darren.