统计工作表中的单元格数
Contents
[
Hide
]
统计工作表中的单元格数
Aspose.Cells for Python via Java提供了统计工作表中单元格数量的功能。为此,API提供了Cells.getCount()或Cells.getCountLarge()属性。
以下代码片段显示了如何使用Cells.getCount()或Cells.getCountLarge()属性来获取工作表中单元格的数量。
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
# Load source Excel file | |
workbook = Workbook(source_directory + "Book1.xlsx") | |
# Access first worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Print number of cells in the Worksheet | |
print("Number of Cells: " + str(worksheet.getCells().getCount())) |