S
sime
Hi All
This is a repost of a previous question. FWIW original post here:
http://groups.google.com.au/group/m...el.programming*&rnum=4&hl=en#d03d34661710c27d
I have worksheets that have "EnableCalculation" = False. They don't
need to recalculate unless the user changes a value.
However, when I force them to calculate I can't seem to guarantee that
a full refresh will happen before calculation is disabled again.
Here's my code:
With ThisWorkbook.Worksheets("MyReport")
.EnableCalculation = True
ThisWorkbook.RefreshAll
.EnableCalculation = False
End With
What happens is, if the user clicks the sheet, the refresh is delayed.
But the code continues to turn off calculation.
So, I want to change my code to the following, but I cannot find the
exquivalent of (the fictitious) "Workbook.NeedsRefreshing":
With ThisWorkbook.Worksheets("MyReport")
.EnableCalculation = True
ThisWorkbook.RefreshAll
While ThisWorkbook.NeedsRefreshing = True
Msgbox "Please wait for the report to refresh."
ThisWorkbook.RefreshAll
Wend
.EnableCalculation = False
End With
A solution would be very much appreciated.
Kind Regards
Simon
This is a repost of a previous question. FWIW original post here:
http://groups.google.com.au/group/m...el.programming*&rnum=4&hl=en#d03d34661710c27d
I have worksheets that have "EnableCalculation" = False. They don't
need to recalculate unless the user changes a value.
However, when I force them to calculate I can't seem to guarantee that
a full refresh will happen before calculation is disabled again.
Here's my code:
With ThisWorkbook.Worksheets("MyReport")
.EnableCalculation = True
ThisWorkbook.RefreshAll
.EnableCalculation = False
End With
What happens is, if the user clicks the sheet, the refresh is delayed.
But the code continues to turn off calculation.
So, I want to change my code to the following, but I cannot find the
exquivalent of (the fictitious) "Workbook.NeedsRefreshing":
With ThisWorkbook.Worksheets("MyReport")
.EnableCalculation = True
ThisWorkbook.RefreshAll
While ThisWorkbook.NeedsRefreshing = True
Msgbox "Please wait for the report to refresh."
ThisWorkbook.RefreshAll
Wend
.EnableCalculation = False
End With
A solution would be very much appreciated.
Kind Regards
Simon