From your C# program, you can control Excel. You can write a program in C# using Visual Studio that works with Excel files. You can create a new file and sheet and add data to and format data and so on. Automation is a process that permits applications that are written in languages such as Visual C# .NET to programmatically control other applications. Automation to Excel permits you to perform actions such as creating a new workbook, adding data to the workbook, or creating charts. Here is a Microsoft article on this called How to automate Microsoft Excel from Microsoft Visual C#.NET.
You could go ahead and create this project yourself. I have created this project locally on my computer in a folder called AutomateExcelFromCSharp.