"%^{F9}" doesn't cause calcaulation
CalculateFull does a more complete recalculation of the workbook. It doesn't
just recalculate the cells which excel considers in need of calculation -
this is what calculate does. Since you didn't write the macro, the original
author appeared to want to do a CalculateFull (which did not exist as a macro
command in xl97 and thus many used the sendkeys combination you show).
From VBA help:
CalculateFull:
Forces a full calculation of the data in all open workbooks.
CalculateFullRebuild: (added in xl2002 I believe)
For all open workbooks, forces a full calculation of the data and rebuilds
the dependencies.
-------------------------------------------
Calculate:
Calculates all open workbooks, a specific worksheet in a workbook, or a
specified range of cells on a worksheet, as shown in the following table.
When using "calculate", To calculate Follow this example
All open workbooks - Application.Calculate (or just Calculate)
A specific worksheet - Worksheets(1).Calculate
A specified range - Worksheets(1).Rows(2).Calculate
----------------------------------------
Whether the more thorough calculation is actually required or not, I can't
say.
--
Regards,
Tom Ogilvy
"clara" wrote:
Hi Tom,
Could you tell me the difference between the two method? They all works well.
Clara
--
thank you so much for your help
"Tom Ogilvy" wrote:
Application.Calculation isn't equivalent to the sendkeys you show.
Try using Application.CalculationFull
--
Regards,
Tom Ogilvy
"clara" wrote:
Hi,
it is in Excel 2000.
--
thank you so much for your help
"JLatham" wrote:
How about using the .Calculate method? Is this code in Excel or another
application?
"clara" wrote:
Hi all,
I use Application.SendKeys "%^{F9}", True to cause calculation, but it
failed. My Excel version 2000.
Clara
--
thank you so much for your help
|