Aspose.Cells.Examples.CSharp.Articles.ShowFormulasInsteadOfValues.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            string filePath = dataDir+ "source.xlsx";

            // Load the source workbook
            Workbook workbook = new Workbook(filePath);

            // Access the first worksheet
            Worksheet worksheet = workbook.Worksheets[0];

            // Show formulas of the worksheet
            worksheet.ShowFormulas = true;

            // Save the workbook
            workbook.Save(dataDir+ ".out.xlsx");
            // ExEnd:1
        }
    }
ShowFormulasInsteadOfValues