bkj
bkj

Reputation: 129

Excel file created using EPPlus has 'invalid format'

I'm using EPPlus on .Net 4.0 using C#. Here is my code:

        FileInfo output = new FileInfo("myFile.xlsx");
        using (var package = new ExcelPackage( output ))
        {
            package.Workbook.Worksheets.Add("TEST");

            var sheet = package.Workbook.Worksheets["TEST"];
            sheet.Cells[1, 1].Value = "TEST";

            package.Save();
        }

I get the following error when I open the file using Microsoft Office Excel 2007. "myFile.xlsx: file format is not valid".

Attached is the error image.

Error

Upvotes: 0

Views: 1710

Answers (1)

bkj
bkj

Reputation: 129

I'm sorry for the confusion - I was using a wrong assembly for reference. Feel like a fool. Sorry. Thanks for the attention given.

Upvotes: 1

Related Questions