简体   繁体   中英

how to hide work sheet in epplus in C#?

I found nothing in web about hiding worksheet in epplus. How can I hide ddworksheet ?

ExcelWorksheet ddworksheet = package.Workbook.Worksheets.Add("DropDownList");

Yes, you can using the Hidden property of the worksheet:

ExcelWorksheet ddworksheet = package.Workbook.Worksheets.Add("DropDownList");
ddworksheet.Hidden = OfficeOpenXml.eWorkSheetHidden.Hidden;

I know this thread is old but for everyones help Hidden will not work if the sheet that you want to be hidden is active, and so use ws.select to select some other sheet before you save. Otherwise hidden will have no impact and only VeryHidden will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM