Visa formler istället för värden i ett kalkylblad
Contents
[
Hide
]
Det är möjligt att visa formler istället för beräknade värden i Microsoft Excel med hjälp av alternativet Visa formler från Formler-fliken. När formler visas visar Microsoft Excel formler i kalkylbladet. Du kan uppnå samma sak med hjälp av Aspose.Cells.
Aspose.Cells tillhandahåller en Worksheet.ShowFormulas-egenskap. Ange detta till true för att ställa in Microsoft Excel att visa formler.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// 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"); |