C++ kullanarak Çalışma Sayfasındaki hücrelerin sayısını sayma
Contents
[
Hide
]
Aşağıdaki örnekte verilen kod örneğinde gösterildiği gibi, çalışma sayfasındaki hücre sayısını Cells.GetCount() veya Cells.GetCountLarge() özelliklerini kullanarak sayabilirsiniz.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
// Source directory path
U16String sourceDir(u"..\\Data\\01_SourceDirectory\\");
// Load source Excel file
Workbook workbook(sourceDir + u"BookWithSomeData.xlsx");
// Access first worksheet
Worksheet worksheet = workbook.GetWorksheets().Get(0);
// Print number of cells in the Worksheet
std::cout << "Number of Cells: " << worksheet.GetCells().GetCount() << std::endl;
// In case the number of cells is greater than 2147483647, use CountLarge
std::cout << "Number of Cells (CountLarge): " << worksheet.GetCells().GetCountLarge() << std::endl;
Aspose::Cells::Cleanup();
return 0;
}