Cell("A1").Value = "Hello World!"; worksheet.Cell("A2").FormulaA1 = "=MID(A1, 7, 5)"; workbook.SaveAs("HelloWorld.xlsx"); }Frequent answersClosedXML is not thread-safe. There is no guarantee that parallel operations will work. The underlying OpenXML library is also not thread-safe...
The following code is an example of how to use it. In this example MATLAB writes to an empty Excel file 'Book1.xlsm' which contains a macro named 'AddNew' that creates a new Excel file called 'test.xls'.