Free Support Forum - aspose.com

Hide sheet

Hello,

is there any possibility to hide sheet programatically? Or are all new added sheets by default visible?

Regards, Boris

Hi Boris,

Yes. All new added sheets are visible by default. I will add a new property to enable you hide sheet at run time. It will be available at the start of next week.

Boris,

Please refer to http://www.aspose.com/Products/Aspose.Excel/Api/Aspose.Excel.Worksheet.IsProtected.html. It’s availabe in hotfix 2.3.3.

Hello Laurence,

I have still problem to SET the property Worksheet.IsProtected. I can only get it. Can you please help me.

Thank you.

Boris

Boris,

To protect a worksheet, please refer to Worksheet.Protect method and Worksheet.Protection property.

Hi Laurence,

I still can not understand how to hide a sheet programatically. Can you please give me an example how to do this.

Thanks.

Boris

Hi Boris,

You can try the following sample code:

Worksheet sheet = excel.Worksheets[0];

//Protect worksheet without a password
sheet.Protect(ProtectionType.All);

//Protect worksheet with a password
sheet.Protect(ProtectionType.All, ''mypassword", null);

Hi Laurence,

the problem is, I want to hide the sheet not to protect them. If I use the code above, I still can see the sheets for wich I applied the Worksheet.Protect(…) method. I can not write or delete in them but I see them.

Can you please help me. Thank you.

Boris

Sorry, I posted the incorrect guide.

Please use the Worksheet.IsVisible property.