NativeExcel2 for .Net Developer's Reference

IRange.FormulaHidden Property

Gets or sets a value that indicates whether the formula in the range will be hidden when the worksheet is protected.

[Visual Basic]

Property Value

true if the formula will be hidden when the worksheet is protected; otherwise, false.


The formula will not be hidden if the workbook is protected and the worksheet is not, but only if the worksheet is protected.


This example sets the formula of cell A6 to calculate the sum of cells A1 through A5, uses the FormulaHidden property to hide the formula.

 IRange r = book.Worksheets[1].Range["A6"]; 
 r.Value = "=SUM(A1:A5)";
 r.FormulaHidden = true;
 Dim r As IRange = book.Worksheets(1).Range("A6")
 r.Value = "=SUM(A1:A5)"
 r.FormulaHidden = True
 IRange* r = book->Worksheets->Item[1]->Range->Item[S"A6"]; 
 r->Value = S"=SUM(A1:A5)";
 r->FormulaHidden = true;

See Also

IRange Interface | NativeExcel Namespace