Hello,
This problem breaks the features used by our customers.
Run the attached project, in first cell type =SPHEREMASS(5,5) and save it to file.
Try to open that file. It generates null object reference.
Please correct it or provide a workaround .
Thank you,
Oleg
Hi,
We have successfully reproduced the behavior you described and passed this ticket to our developers for further research.
As a workaround, I suggest you set the CustomFunctionExportMode property to "Function" to avoid the problem.
Please bear with us. We will notify you as soon as we make any progress.
We cannot use "Function", because we need to translate custom functions to values because our custom functions are not supported on receiving side. We really need the workaround because it affects customers now. Could you please provide code snippet which replaces functions with their values cell by cell? We plan to use something like that as a workaround, it will run before we same the workbook:
workbook.BeginUpdate();
workbook.DocumentSettings.Calculation.Mode = CalculationMode.Manual;
foreach (var cell in from worksheet in workbook.Worksheets
select worksheet.GetExistingCells()
into cells
from cell in cells
where cell.HasFormula
select cell)
{
cell.CopyFrom(cell, PasteSpecial.Values);
}
workbook.EndUpdate();
If you can give us the code sample that would be great.
Hi,
As for the workaround you require, you can use the following code block:
workbook.BeginUpdate(); try { foreach(Worksheet sheet in workbook.Worksheets) { foreach(Cell cell in sheet.GetExistingCells()) { if(cell.HasFormula) cell.Value = cell.Value; } } } finally { workbook.EndUpdate(); }
If you need further assistance, let me know.