Contare il numero di celle nel foglio di lavoro

Contents
[ ]

Puoi contare il numero di celle nel foglio di lavoro utilizzando le proprietà Cells.count o Cells.count_large come mostrato nell’esempio di codice riportato di seguito.

from aspose.cells import Workbook
# Source directory
sourceDir = "./"
# Load source Excel file
workbook = Workbook(sourceDir + "BookWithSomeData.xlsx")
# Access first worksheet
worksheet = workbook.worksheets[0]
# Print number of cell in the Worksheet
print("Number of Cells: " + str(worksheet.cells.count))
# In the number of cells is greater than 2147483647, use CountLarge
print("Number of Cells (CountLarge): " + str(worksheet.cells.count_large))