This project has moved and is read-only. For the latest updates, please go here.

EPPlus search Worksheet by name

Dec 18, 2012 at 3:34 PM

Hello everybody

Now i'm using workBook.Worksheets.First() to open the first worksheet of a XLSX file.

There's a way to open a specify worksheet through a given string?

Thanks everybody


Dec 19, 2012 at 12:37 PM
Edited Dec 19, 2012 at 12:37 PM

Yes it is possible, Worksheets is indexed with string.

        public ExcelWorksheet GetWorksheet(string a_name)
            return m_excelPackage.Workbook.Worksheets[a_name];



Jan 29, 2013 at 10:07 PM


public static void HideSheet(string srcFile, string sheet)
                FileInfo file = new FileInfo(srcFile);
                ExcelPackage package = new ExcelPackage(file);
                ExcelWorksheet mySheet = package.Workbook.Worksheets.First(x => x.Name == sheet);
                mySheet.Hidden = eWorkSheetHidden.Hidden;                
            catch (Exception ex)
That way you can use things like x.Name.Comtains, etc.