Hukonaki
Hukonaki

Reputation: 11

Adding data to existing Excel worksheet in Visual Studio C#

I'm currently working on creating a minesweeper game in Visual Studio C#, and i would like to add a feature that can tell the player both their winrate and average time.

Is there a way for me to create an excel worksheet, and transfer data from my program to that worksheet?

Upvotes: 1

Views: 41

Answers (1)

Sandris B
Sandris B

Reputation: 133

Look at this

It's easy to use

   IWorkbook workbook = new XSSFWorkbook();
        ISheet sheet1 = workbook.CreateSheet("References");

        int row = 0;

        IRow excelrow = sheet1.CreateRow(row);
        excelrow.CreateCell(3, CellType.Numeric).SetCellValue(dataList.Total_items);

Upvotes: 1

Related Questions