This project has moved. For the latest updates, please go here.

multiple sheets not getting data after first sheet

Jan 22, 2015 at 3:06 PM
So I created an excel sheet works fine. If I add more than one excel sheet the sheet gets created.
However there is no data or even headers on the 2nd and 3rd sheets.

I am guessing some how I have to set which is current active sheet?

Can someone tell me how to do this?
If you need my code I can reply with it.


Thanks.
Developer
Jan 22, 2015 at 8:55 PM
I dont really get what the problem is, but hopefully this can help:
using(var pck = new ExcelPackage())
{
   pck.Workbook.Worksheets.Add("WS 1");
   pck.Workbook.Worksheets.Add("WS 2");

   var currentSheet = pck.Workbook.Worksheets["WS 1"];
   // change sheet
   currentSheet = pck.Workbook.Worksheets["WS 2"];
}
Jan 22, 2015 at 9:09 PM
I found my problem.
It was putting the data on the page.
Just way down. I forgot to set the row start back to 1. oops :-).

Thanks anyways.