We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cells with Formula return Error:520

After upgrading to ASPOSE.Total for NET Q3 I have problems with the cells with Formulas (I have downloaded the last version available and the problem persists.

When I open the spreadsheet file I find an error 520 in every cell with formula (the cell content is =).

I use this code snippet to test it (I have used different formats ODS, XLS97TO2003, …) and the problem persists:

Dim xls As New Aspose.Cells.Workbook(Aspose.Cells.FileFormatType.Xlsx)

Dim wk As Aspose.Cells.Worksheet = xls.Worksheets(0)

wk.Cells(0, 0).PutValue(32.2)

wk.Cells(0, 1).PutValue(48)

wk.Cells(0, 2).R1C1Formula = “=SUM(R[0]C[0]:R[0]C[1])”

wk.Cells(0, 3).R1C1Formula = “=R[0]C[0]-R[0]C[1]”

wk.Cells(0, 4).Formula = “=A1”

wk.Cells(0, 5).R1C1Formula = “=A1-B1”

xls.CalculateFormula()

xls.Save(Me.Response, “test.xlsx”, Aspose.Cells.ContentDisposition.Inline, xls.SaveOptions)

I don’t know if this helps, but I am from Spain (so my culture is es-ES).

It is quite urgent to solve it because this bug affect to all my reports.

Thanks in advance…Antonio


Hi,

Well, you line of code i.e. wk.Cells(0, 5).R1C1Formula = “=A1-B1” is invalid, either you should specify the formula in R1C1 style or you should use Formula property instead.

Also the line of code:
xls.Save(Me.Response, “test.xlsx”, Aspose.Cells.ContentDisposition.Inline, xls.SaveOptions)

is not right as it will create xls(Excel97-2003) file instead of xlsx file format, you should use:
xls.Save(Me.Response, “test.xlsx”, Aspose.Cells.ContentDisposition.Inline, New OoxmlSaveOptions())

See the topic for further reference:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/saving-files.html

Thank you.