On Fri, May 22, 2026 at 3:04 AM Tomaž Vajngerl <[email protected]> wrote:
> Hi Ben, > > On Fri, May 22, 2026 at 10:03 AM Benjamin Urban <[email protected]> > wrote: > > I guess my question, then, would be: How can I make the cell appear to > be an error, while still storing a valid (non-error) value? > > Maybe just set the text as you already do in cellform.cxx, but just > return "ScGlobal::GetErrorString(FormulaError::NotAvailable);". > I would just go with #N/A! because adding new errors is complicated > when you want to write that to OOXML. I didn't check if there is some > kind of extension to OOXML, but in the case of #SPILL! it is converted > to #VALUE! when saving to an OOXML document, because you can't extend > it with #SPILL! without breaking backwards compatibility. > In fact, I already had to add a new error code, for when a call is attempted with a value that is not a function. One question: if I understand correctly, if you do this then you can > use the LAMBDA by referencing the cell -> like A1: =LAMBDA(a,b, a+b) > and then in B1: =A1(1,2) ? I tried this with MSO and GSheets but that > didn't work. > > Tomaž > Yes, that works fine. I actually didn't realize it doesn't work in MSO and GSheets. On further investigation, it seems GSheets only allows that sort of syntax if you refer to it using a name, rather than a cell reference. I wonder why they decided to do that, as I don't see a way that it wouldn't be extra effort.
