using System;
using Aspose.Cells;
namespace RemoveExcelFormulaWithoutRemovingContentsInCSharp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Instantiate license to avoid trial version watermark
            License license = new License();
            license.SetLicense("Aspose.Cells.lic");

            // Load the workbook containing data and formula
            Workbook workbookWithFormula = new Workbook("WorkbookWithFormula.xlsx");

            // Get the reference of the cell whose formula is to be removed
            Cell cellWithFormula = workbookWithFormula.Worksheets[0].Cells["C1"];

            // Store value in a temporary variable
            Object tempData = cellWithFormula.Value;
            
            // Remove formula
            cellWithFormula.Formula = "";

            // Reset cell value using the temporary variable
            cellWithFormula.Value = tempData;

            // Save the workbook
            workbookWithFormula.Save("WorkbookWithoutFormula.xlsx");
        }    
    }
}