URGENT Setting the .Value of a cell with custom formula wipes out the formula

There are two problems.

1. I have add-in formulas that I process with a class that implements Aspose.Cells.ICustomFunction. However if I set the .Value property of a cell it wipes out the formula associated with that cell.

2. If I save a workbook, then the Value of all of all the formula cells is reset to nothing.

I need a way to have both the value and the formula be saved when the workbook is saved, basically I need custom formulas to behave the same way as standard formulas, aside from the fact that I have to calculate the values.

We have clients that are waiting for the solution, thank you

Hi,

Could you post your sample code (preferably a console demo app. if you could provide us) with template file(s) here, we will check your issue soon.

Thank you.

Actually I think I figured out my problem. It was related to mixing Excel Object model and Aspose in the same application.

Also I figured out that I shouldn't be calling PutValue() from the CalculateCustomFunction method of the class I created to handle custom functions. Instead I should simply return the value and Aspose.Cells will put it in the correct cell without blowing affecting the forumula.

Although I am not sure why, when I save the workbook it clears out the formula fields? See my attached test application and test excel file, watch cell B2. Although I can work around this by re-opening the Workbook again.

Hi,

Well, it is to be noted here for you info, when you call Workbook.Save() method, the whole data in the workbook (all types of of data including objects etc.) would be cleared and null.

Thank you.