template<class Collection, class Item>
class wxAutoExcel::wxExcelCollectionIterator< Collection, Item >
An iterator over the items of a Microsoft Excel collection.
The collection classes, such as wxExcelWorksheets, wxExcelShapes, or wxExcelNames, as well as wxExcelRange, have begin() and end() methods returning this iterator, so that their items can be iterated over with a range-based for loop:
wxLogMessage("Worksheet '%s'", worksheet.GetName());
Represents Microsoft Excel Worksheet.
Definition wxAutoExcelWorksheet.h:23
Dereferencing the iterator obtains the item from Excel and returns it by value. As wxAutoExcel objects are just references to Excel objects, the loop variable should be a value (or auto), not a reference.
The number of items is obtained by end(), the items are obtained one by one, by their index starting from 1. Therefore, the items must not be added to or removed from the collection while iterating over it. If an item cannot be obtained, it is invalid and the error is reported according to the error mode, see wxExcelObject::SetErrorMode_(). When the number of items cannot be obtained, there is nothing to iterate over.