completed modification writeExcelToDatabase