Check the number of sheets before accessing any sheet in the Excel file

Issue: GCP-10075

Reviewer: Glenn