GetCells()

IExcelDataWorkbook::GetCells(System::String, bool) method

Retrieves a collection of cells from the workbook that match the specified formula.

virtual System::SharedPtr<System::Collections::ObjectModel::ReadOnlyCollection<System::SharedPtr<IExcelDataCell>>> Aspose::Slides::Excel::IExcelDataWorkbook::GetCells(System::String formula, bool skipHiddenCells)=0

Arguments

ParameterTypeDescription
formulaSystem::StringA formula or range expression (e.g., "Sheet1!A1:B3") used to identify target cells.
skipHiddenCellsboolIf true, hidden cells (e.g., in hidden rows or columns) will be excluded from the result.

Return Value

A read-only list of cells that match the specified formula.

Remarks

Example:

System::SharedPtr<ExcelDataWorkbook> wb = System::MakeObject<ExcelDataWorkbook>(testFile);
System::SharedPtr<System::Collections::ObjectModel::ReadOnlyCollection<System::SharedPtr<IExcelDataCell>>> cells = wb->GetCells(u"Sheet1!A2:A6", false);
System::Console::WriteLine(cells->get_Count());

See Also