Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create new Excel File #74

Open
pierreSLA opened this issue Apr 20, 2023 · 0 comments
Open

Cannot create new Excel File #74

pierreSLA opened this issue Apr 20, 2023 · 0 comments

Comments

@pierreSLA
Copy link

Maybe i'm not understanding correctly but if i don't have a template file, how can i create a new excel file.
While updateing the worksheet i get nullreference exception.
Why do i need a template file at all?
var templateFS = File.Create(templateFile) using (FileStream fs = File.Create(tempFile)) using (var fe = new FastExcel.FastExcel(templateFS, fs)) { var ws = new FastExcel.Worksheet(); foreach (var rn in Enumerable.Range(1, 1000)) { var data = new List<Cell>(); var row = new Row(rn, data); data.Add(new Cell(1, $"lala{rn}")); data.Add(new Cell(2, $"{11.1 + rn}")); data.Add(new Cell(3, $"{22.2 + rn}")); ws.AddRow(data); } fe.Update(ws, 0); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant