Afficher les formules au lieu des valeurs dans une feuille de calcul
Contents
[
Hide
]
Il est possible d’afficher des formules au lieu des valeurs calculées dans Microsoft Excel en utilisant l’option Afficher les formules de l’onglet Formules. Lorsque les formules sont affichées, Microsoft Excel affiche les formules dans la feuille de calcul. Vous pouvez obtenir le même résultat en utilisant Aspose.Cells.
Aspose.Cells fournit une propriété Worksheet.ShowFormulas. Définissez-la sur true pour demander à Microsoft Excel d’afficher des formules.
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"); |