Paolo wrote:
>Thanks Antony, following your suggestion I've added this macro to my
workbook
>
>Private Sub Workbook_Open()
> For Each ws In Worksheets>
> ws.UsedRange.Calculate
> ws.Calculate
> Next ws
> Application.Calculation = xlCalculationAutomatic
> Application.Calculate
> Application.CalculateFull
> Application.CalculateFullRebuild
>End Sub
>
>This way when the file is opened after being modified with poi it
>tries to recalculate every formulas.
This solution worked fine but when you open the excel file you are asked to
save the changes, that are actually made by the recalculation.
We solved this by introducing the following macro:
Sub workbook_open()
If Tabelle3.Cells(1, 1).Value = 1 Then
' Application.CalculateFullRebuild is definitely enough
Application.CalculateFullRebuild
Tabelle3.Cells(1, 1).Value = 0
Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.DisplayAlerts = True
End If
End Sub
>From the POI side, we write a value of 1 into a well defined cell in a well
defined sheet (here Tabelle3(1,1)), so recalculation is only performed the
first time you open the workbook and is automatically saved without user
interaction.
--
View this message in context:
http://www.nabble.com/Excel-2003-does-not-update-formula-tf3188604.html#a12672711
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail:
user-unsubscribe@poi....
For additional commands, e-mail:
user-help@poi....
opensubscriber is not affiliated with the authors of this message nor responsible for its content.