FPSpreadsheet: set a cell to #N/A lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- upsidasi · 2022-06-09 11:00 Hi, What is the correct way to set a cell to #N/A in FPSpreadsheet? I tried the following options: molWS.WriteNumber(ARow, ACol, Nan);  ==> doesn't workmolWS.Writeform WriteCellValueAsString(ARow, ACol, '#N/A');  ==> doesn't workmolWS.Writeform WriteText(ARow, ACol, '#N/A');  ==> doesn't workmolWS.WriteFormula(ARow, ACol, '#N/A'); ==> it works, but is it the way to go? Would it be different if I wanted to set a cell to #NUM! or #VALUE! ? Thanks! ---------------------------------------------------------------------- wp · 2022-06-09 11:49 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type   TsWorksheet = class(...)    function WriteErrorValue(ARow, ACol: Cardinal; AValue: TsErrorValue): PCell; overload;    procedure WriteErrorValue(ACell: PCell; AValue: TsErrorValue); overload;where TsErrorValue is declared in unit fpsTypes Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   {@@ Error code values     @value  errOK                  ok, no error    @value  errEmptyIntersection   A space was used in formulas that reference multiple ranges; a comma separates range references (#NULL!)    @value  errDivideByZero        Trying to divide by zero (#DIV/0!)    @value  errWrongType           The wrong type of operand or function argument is used (#VALUE!)    @value  errIllegalRef          A reference is invalid (#REF!)    @value  errWrongName           Text in the formula is not recognized (#NAME?)    @value  errOverflow            A formula has invalid numeric data for the type of operation (#NUM!)    @value  errArgError            A formula or a function inside a formula cannot find the referenced data (#N/A)    @value  errFormulaNotSupported This formula is not suppored by fpSpreadsheet (error code not used by Excel and Calc)   }  TsErrorValue = (    errOK,                 // no error    errEmptyIntersection,  // #NULL!    errDivideByZero,       // #DIV/0!    errWrongType,          // #VALUE!    errIllegalRef,         // #REF!    errWrongName,        // #NAME?    errOverflow,           // #NUM!    errArgError,         // #N/A  ( = #NV in German )    errFormulaNotSupported // No excel error  ); ---------------------------------------------------------------------- upsidasi · 2022-06-09 12:58 Thank you wp! I clearly need a new pair of glasses!