View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default Improve Speed by desabling Automatic Calculation

Hi Alex,

When you have more than 1 workbook open Excel calculates all the open
workbooks, so if you have your linked workbook open it gets recalculated as
well and so it takes more time.

Setting Application.Calculation back to automatic from manual makes Excel
Recalculate whatever needs calculating (this presumably takes about 10
seconds). Then the next application.calculate does not do anything because
there is nothing that needs calculating.

Charles
______________________
Decision Models
FastExcel 2.2 Beta now available
www.DecisionModels.com

"Alex St-Pierre" wrote in message
...
I have a Macro which update an excel sheet (by opening an other excel file
and copy-paste data) When I update the file, the macro takes about 1 sec.
to
execute.

Often, I have an other sheet which is linked to the updated excel sheet;
it
takes about 2 minutes to execute the Macro.

I decided to desabled automatic calculation by doing:
Application.Calculation = xlManual
'Program..
Application.Calculation = xlAutomatic
Application.Calculate ('this doesn't affect the speed.. very fast)

After doing this, the Macro takes 10 seconds to execute.
If I break down the link, it takes 1 second.

Why the Macro doesn't 1 second if I desables automatic calculation ?
Is there a way to execute my Macro in 1 second by suspending all excel
refresh ?

Thank you!
--
Alex St-Pierre