Hidden Worksheets
Applies to |
---|
The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office. Project type
Microsoft Office version
For more information, see Features Available by Application and Project Type. |
Microsoft Office Excel worksheets that are formatted as hidden are not visible in the Visual Studio designer, but they are visible in Solution Explorer. Double-clicking the sheet in Solution Explorer opens the code file for the sheet, instead of opening the visual designer.
Hiding a Worksheet Programmatically
You can hide worksheets programmatically so that they are visible in the visual designer, but are not visible when the solution runs, by using the worksheet property xlSheetHidden or xlSheetVeryHidden. For example, you can put the following code in the code file behind the sheet you want to hide.
Me.Visible = Excel.XlSheetVisibility.xlSheetVeryHidden
this.Visible = Excel.XlSheetVisibility.xlSheetVeryHidden;
The property xlSheetHidden hides the sheet, but it can be made visible by any user through the Excel user interface. If you use xlSheetVeryHidden, however, the user cannot make the sheet visible through the Excel user interface.
See Also
Concepts
Office Documents in the Visual Studio Environment Overview