add function of generating the Excel file