How to hide specific Excel spreadsheets using the expensive VSTO code?

In my Vsto Excel project, I want to hide multiple sheets of my Excel using vsto code? How can I hide any particular sheet using its name or sheet number?

Thank you very much in advance.

+3
source share
1 answer

Suppose the name excel is set to MySheet .

To hide it, use

((Excel.Worksheet)Globals.ThisWorkbook.Sheets["MySheet"]).Visible = Excel.XlSheetVisibility.xlSheetHidden;
+4
source

All Articles