Write data into Excel file at runtime during test execution

i think my code for write into excel is wrong, anyone can help me here?