Compiler gives error "GetTotalSheetCount(pSheets)" is undefined. Would you be so kind to give the implementation of this function, please