Writing to Excel without using DCOM
using ClosedXML.Excel;
using var wbook = new XLWorkbook();
var ws = wbook.AddWorksheet("Sheet1");
ws.FirstCell().Value = 150;
ws.Cell(3, 2).Value = "Hello there!";
ws.Cell("A6").SetValue("falcon").SetActive();
ws.Column(2).AdjustToContents();
wbook.SaveAs("data.xlsx");