Forum Discussion
LAMBDA Examples: Distance between two cities
Are there plans to support names defined using LAMBDA functions to be distributed via Add-ins or are we back to PERSONAL.xlsb Cheers Sam
Given a named formula MyFunc in Book1, we should be able to call it from another workbook (as with vba functions):
=Book1!MyFunc(123)
If MyFunc =LAMBDA(x,x) this returns an error on my build but I assume it will work soon. Instead we could test with MyFunc = MyVBAFunc where
Function MyVBAFunc(x): MyVBAFunc = x: End Function
To access MyFunc as an add-in function without the Book1! prefix we would need to press Ctrl+F11 to open a macro sheet and change the definition in the define name dialog to a function. Or equivalently from vba:
Names("MyFunc").MacroType=xlFunction
For a simple test define the name MyFunc:=123 as a function and set the workbook IsAddin property to True. This name is then accessible from any workbook.
- Sameer_BhideDec 10, 2020Iron Contributor
Wow ! - How did you figure that out - I am going to give this a shot on my install and see how it goes.
Cheers
Sam
- Dec 09, 2020
All the customs formula made with LAMBDA to be a way to stored/export online & those can be globally accessible to any workbook under that M365 subscription account.
It will be always safe and no loss of function in case of system crash.
Regards, Faraz Shaikh
- lori_mDec 09, 2020Iron Contributor
Agreed, ideally we could store a library of these functions accessible from any workbook. Function scope should be global like XLL / .js custom functions and not linked to a particular workbook as with VBA udfs.