Protect a range of cells

Hi,

I was trying to protect a range of cells through the Protected property, but this property is not a member of Cellrange. Is there another way to do it?

Oliver

Hi Oliver,

A method named SetProtected has been added for Worksheet class in Aspose.Grid.Desktop v2.0.1.27 (attached). Please try this line with the attached version:

grdDataEntry.Worksheets[0].SetProtected(new CellRange("b2", "d6"), true);

Thank you.

Thanks for the update.

I use now the following code

Dim sheet As Aspose.grid.Desktop.Worksheet=GridDesktop.Worksheets(Me.GridDesktop.ActiveSheetIndex)

Dim selection As Aspose.Grid.Desktop.CellRange=sheet.GetLastSelection

grdDataEntry.sheet.SetProtected(selection,True)

However, it seems grdDataEntry needs to be declared. I could not find any information about grdDataEntry in the documentation. What is grdDataEntry doing? Would appreciate further help.

Hi,

Well, "grdDataEntry" is a sample name for GridDesktop control/object,

Please change your code to:

Dim sheet As Aspose.grid.Desktop.Worksheet=GridDesktop.Worksheets(Me.GridDesktop.ActiveSheetIndex)

Dim selection As Aspose.Grid.Desktop.CellRange=sheet.GetLastSelection

sheet.SetProtected(selection,True)

Thank you.

The issues you have found earlier (filed as 10012) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.