This project has moved and is read-only. For the latest updates, please go here.

Protect Workbook and IsFormula()

May 29, 2012 at 12:02 PM
Edited Aug 28, 2012 at 11:33 AM

1-      Is it possible to protect the whole Workbook structure with password ?

2-      Is there a way to check whether the cell contains formula or not ?

My Best Regards,

 

Aug 28, 2012 at 11:47 AM
Edited Aug 28, 2012 at 11:49 AM

Can you please reply to these questions.

Aug 29, 2012 at 6:55 PM

1. No, sorry.

2. You can check the value of cell.FormulaA1. I'll think about adding a .HasFormula property.

Sep 4, 2012 at 3:51 PM

Regarding checking for formulas, the following works for me:

string value = string.Empty;
IXLCell cell = row.Cell(colNumber);
if (string.IsNullOrEmpty(cell.FormulaA1))
{
    value = cell.GetString().Trim();
}
else
{
    value = cell.ValueCached.Trim();
}