Set the active sheet to 0 before write the Excel