Hi,
I have a problem when I open an excel file, I have some cells with formula and when I get the values of them were like they haven’t change since the last time the file was saved.
this is the code I use to open the excel file and I want you know that I’m using an Aspose.Excel.dll:
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
ds = ViewState("tab")
file = New ExcelDesigner()
file.Open(ViewState("url"))
Dim fi As Integer = 0
Do While fi < ds.Tables(0).Rows.Count
file.Excel.Worksheets(0).Cells(fi + 1, 0).PutValue(ds.Tables(0).Rows.Item(fi).Item(“Codigo”).ToString)
file.Excel.Worksheets(0).Cells(fi + 1, 1).PutValue(ds.Tables(0).Rows.Item(fi).Item(“Nombre”).ToString)
file.Excel.Worksheets(0).Cells(fi + 1, 2).PutValue(ds.Tables(0).Rows.Item(fi).Item(“1er Trim”).ToString)
file.Excel.Worksheets(0).Cells(fi + 1, 3).PutValue(ds.Tables(0).Rows.Item(fi).Item(“2do Trim”).ToString)
file.Excel.Worksheets(0).Cells(fi + 1, 4).PutValue(ds.Tables(0).Rows.Item(fi).Item(“3er Trim”).ToString)
file.Excel.Worksheets(0).Cells(fi + 1, 5).PutValue(ds.Tables(0).Rows.Item(fi).Item(“Pers").ToString)
fi += 1
Loop
file.Process()
file.Save(ViewState("url”), FileFormatType.Default)
End Sub
… and when I close my app and open the excel file again and get the value of the cell with this line of code:
cell = file.Excel.Worksheets(0).Cells(1, 0).Value
… I just get an old value, the last result of a formula in a sheet cell. the only way I found to update the result is to open excel file, normally, making double clic on the file, and then closing it.
I hope you can help me
Thanks
This message was posted using Email2Forum by tilal.ahmad.