ワークシートで値の代わりに数式を表示する
Contents
[
Hide
]
Microsoft Excel では、数式の表示オプションを使って計算結果の代わりに数式を表示することが可能です。数式が表示されると、Worksheet内に数式が表示されます。同じ操作をAspose.Cells for Python via .NETでも実現できます。
Aspose.Cells for Python via .NETは、Worksheet.show_formulasプロパティを提供します。これをtrueに設定すると、Microsoft Excelが数式を表示するようになります。
This file contains hidden or 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
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
filePath = dataDir + "source.xlsx" | |
# Load the source workbook | |
workbook = Workbook(filePath) | |
# Access the first worksheet | |
worksheet = workbook.worksheets[0] | |
# Show formulas of the worksheet | |
worksheet.show_formulas = True | |
# Save the workbook | |
workbook.save(dataDir + ".out.xlsx") |