Forum Discussion
Jeanga
Apr 03, 2021Copper Contributor
fonctions personnalisées provoquent une erreur #NOM?
Bonjour, mes fonctions personnalisées provoquent une erreur #NOM? dans la cellule. Mes fonctions donnent un résultat correct lors d'un appel depuis un SUB en VBA. Mes fonctions n'apparaissent pas d...
PeterBartholomew1
Apr 03, 2021Silver Contributor
Sorry, I misread your original post where it mentioned the SUB. Is the problem with a specific function or can't you define UDFs at all?
Jeanga
Apr 04, 2021Copper Contributor
don't be sorry, no issue 🙂
It do the same with every customized functions.
When you write the equal sign (=) in a cell and a letter, Excel propose you a list of functions that begin with this letter. ie =s -> SEC, SECH, SECONDE, and so on.
Mine doesn't appear in this list.
If I bind my function with an alias (like in the LAMBDA example) by the Name Manager, the Alias appear in the list but it still generat a #NAME? error in the cell.
I defined the folder where my Workbook is stored as trust folder in the Excel parameters, it doesn't change anything.
I think the way for me to fix it is in the parameters but I didn't find it.
Sorry to be angry yesterday, for me computers HAVE TO work, and I have no patience for this meanings 😞
It do the same with every customized functions.
When you write the equal sign (=) in a cell and a letter, Excel propose you a list of functions that begin with this letter. ie =s -> SEC, SECH, SECONDE, and so on.
Mine doesn't appear in this list.
If I bind my function with an alias (like in the LAMBDA example) by the Name Manager, the Alias appear in the list but it still generat a #NAME? error in the cell.
I defined the folder where my Workbook is stored as trust folder in the Excel parameters, it doesn't change anything.
I think the way for me to fix it is in the parameters but I didn't find it.
Sorry to be angry yesterday, for me computers HAVE TO work, and I have no patience for this meanings 😞
- JeangaApr 08, 2021Copper Contributor
@everyone
I found the way to use my customized Functions in my Sheet.
Simply declare the functions in a CLASS MODULE, not in the Workbook or Worksheets code modules.
Thanks to those who tried to help me.
If one (or more) of you gave me this trick, please apologize. I didn't understand your meaning.
I don't remember I had to declare my functions in a Class Module before.
Well, it works, I love to code.
Thanks to all 🙂
- PeterBartholomew1Apr 08, 2021Silver Contributor
Thank you for the update, though I have never had to use a Class module for the purpose of creating a UDF. I notice an earlier post from JMB17 that asked whether you were using a standard module. It appears that he was at least on the right lines.