Forum Discussion

ecovonrein's avatar
ecovonrein
Iron Contributor
Apr 18, 2023

Local scope Lambda randomly produces #NAME

Looking for experiences from readers here.

 

We have a large-scale Excel production environment and I am presently engaged in reprogramming it to take advantage of new SPILLs and LAMBDAs.

 

Unlike AFE, which seems to have no time for local scope Lambdas, I very much embrace them as a way of turning a Worksheet into a kind-of object.  So we might imagine a Workbook made up of different Worksheets, each holding a particular database.  These database structures can be completely different from one another, but if each Worksheet offers a local Lambda eg "TimeSeries" then a database user (in another Worksheet) does not need to concern himself with the structure of the underlying databases but can simply call DBase1!TimeSeries(...) or DBase2!TimeSeries(...) and delegate the responsibility for producing a particular data structure (the timeseries) to DBase1 and DBase2 (who know the laypout of their respective databases).

 

This all works very well.  Until it doesn't.  Because the call to DBase!TimeSeries suddenly produces #NAME.  I have found a way for repairing the issue.  Until it suddenly appears again.

 

The way I fix the problem goes like this:

I rename "TimeSeries" in "DBase1" to "TimeSeriesA".  Calc.  All errors disappear.  I rename "TimeSeriesA" back to "TimeSeries" and all is good.

 

Has anyone stumbled upon something similar?  Figured out what's provoking this behaviour?  Thanks.

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    Host of questions:
    Have you sent a frown to the Excel team about this?
    Do you have repro steps and/or a sample workbook in this state?
    Does Control+Alt+Shift F9 get rid of the #Name! errors?
    What does the offending lambda (and dependencies) look like?
    • ecovonrein's avatar
      ecovonrein
      Iron Contributor
      No, and no. I do not bother to report errors that I cannot reliably (and demonstrably) reproduce. This one comes and goes as it sees fit. The Lambdas are very challenging. I realize that now that my 4-month development is coming to an end. My new model clearly pushes the boundaries of what Excel can currently support. I have a feeling (no more!) that this all relates to this:
      https://techcommunity.microsoft.com/t5/excel/excel-bug-limited-willingness-to-copy-lambdas-from-local-scope/m-p/3722676#M177974
      I am actually now sitting on the finishes model that I cannot copy between workbooks. Unreal.
      (I am about to send "a frown" about that. I urgently need that copy bug fixed.)

      I only reported it here in the vain hope that someone (like yourself) might have stumbled upon the same problem and found a way to reproduce it.
      • JKPieterse's avatar
        JKPieterse
        Silver Contributor
        I've reported these issues to the team directly, see what happens 🙂

Resources