+ Reply to Thread
Results 1 to 35 of 35

Getting #NAME error when trying to call a function

  1. #1
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Getting #NAME error when trying to call a function

    Hi,

    I am currently experiencing an issue whereby, i have received an excel file from a colleague which is running a specific function. However, when i try to run that function on my computer i get the #NAME error. The function basically just creates an array of values.

    Any advice would be much appreciated.

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,810

    Re: Getting #NAME error when trying to call a function

    Did you allow macros to be enabled when you opened the file?

    Pete

  3. #3
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Re: Getting #NAME error when trying to call a function

    Hi,

    Yes i did.

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,237

    Re: Getting #NAME error when trying to call a function

    Maybe a colleague is using an Excel function that is not available in your version of Excel.
    Is this an Excel function or a custom function written in VBA?

    Artik

  5. #5
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Re: Getting #NAME error when trying to call a function

    Hi i dont think thats the case because its a custom function developed with VBA

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Getting #NAME error when trying to call a function

    Well, since guessing and assuming is not used in programming or writing formula I think this post could go on for ages.
    Why don't you just paste the function and or context, formula or vba code so that you might get logical answers?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  7. #7
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Re: Getting #NAME error when trying to call a function

    Thanks for your reply. I know for a fact that it's not an issue with the code because my colleague had his laptop next to mine, ran the exact same code and called the function in the exact same way as i did on my computer and the function worked on his computer but got error #NAME on mine.

    Cheers

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Getting #NAME error when trying to call a function

    Maybe check Tools - References for missing Reference.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  9. #9
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,084

    Re: Getting #NAME error when trying to call a function

    i have recreated that issue on a file that i first uploaded to google drive, then downloaded again.

    heres how i fix it:

    1. double click the topmost cell in a column that has the #NAME? error.
    2. double click the formula to highlight it all
    3. press the right arrow to get to the end of the formula
    4. now click the ENTER key
    this should fix the error in that cell
    5. click that cell again to select it
    6. now drag down to other cells that share the same formula
    Last edited by janmorris; 09-05-2021 at 04:04 AM.

  10. #10
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Re: Getting #NAME error when trying to call a function

    Thanks for your suggestions but I checked both of them and they made no difference.

    Cheers

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Getting #NAME error when trying to call a function

    We can keep on guessing but it would be a lot easier when you post an example file with some data to work with and the function in it.

  12. #12
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,309

    Re: Getting #NAME error when trying to call a function

    your comment in post #5 proves nothing.
    why not follow @Kebellah's advice in post #6, you may get closer to a resolution than continuing random guesswork.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  13. #13
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Re: Getting #NAME error when trying to call a function

    Ok attached is the file. Please be aware that i am an absolute amateur at macros (and excel in general) - thx
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,237

    Re: Getting #NAME error when trying to call a function

    Does your version of Excel support spilled formulas?

    Artik

  15. #15
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Getting #NAME error when trying to call a function

    Will check and get back to you, but, without vba and little Excel knowledge you'll not get far and have to depend on others, I suggest you Goggle for tutorials starting from basics, it really helps and trial and error recording macros and editing is how moet of us started. I never had or followed any courses

  16. #16
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,084

    Re: Getting #NAME error when trying to call a function

    like you i also avoid VBA, but that is because im on macOS and theres some VBA errors that cannot fixed when transporting an excel file from windows to mac.

    anyhow, heres what i get (i guess its working fine)
    Attached Images Attached Images

  17. #17
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Getting #NAME error when trying to call a function

    And now you come with it, MAC and Windows
    You could have started with THAT!
    Eating someone’s time with incomplete information
    Good luck

  18. #18
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,598

    Re: Getting #NAME error when trying to call a function

    Quote Originally Posted by Keebellah View Post
    And now you come with it, MAC and Windows
    You could have started with THAT!
    Eating someone’s time with incomplete information
    Good luck
    The OP didn't say he was using a Mac, janmorris uses a Mac.

    That asid, it works OK on Windows 64 bit with a Windows 365 subscription.

    I can make it produce a #SPILL! error by putting something in a cell below the formula, but not a #NAME! error.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  19. #19
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,598

    Re: Getting #NAME error when trying to call a function

    The only way I can get a #NAME? error is if the name of the function is misspelled or the function doesn't exist (same difference really).

  20. #20
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Re: Getting #NAME error when trying to call a function

    Ok thanks for your input. Looks like the issue is that I am not running office 365 and office 2019 doesnt support spilled formulas?

    Cheers

  21. #21
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Re: Getting #NAME error when trying to call a function

    Keebellah, please dont be rude

  22. #22
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,598

    Re: Getting #NAME error when trying to call a function

    Not sure. I don't think that would give you a #NAME? error.

    https://support.microsoft.com/en-us/...1-87a7eb36e531

    Have you tried inputting the formula as an Array Formula using Ctrl-Shift-Enter and dragging the formula down? Can't see that working though.

    Is it exactly the same workbook that has the formula that doesn't work? Or have you copied and/or retyped the formula?

    All I CAN say is it works for me as uploaded in Windows 64 bit with Excel 365 subscription.

  23. #23
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,274

    Re: Getting #NAME error when trying to call a function

    You'd only get a #NAME error there if macros are disabled.
    Remember what the dormouse said
    Feed your head

  24. #24
    Registered User
    Join Date
    09-04-2021
    Location
    New zealand
    MS-Off Ver
    2019
    Posts
    9

    Re: Getting #NAME error when trying to call a function

    Hi, have tried cntrl+shift+enter - didnt work. Yes it is the same workbook and i have tried copying and re-typing the formula. Think i could maybe get the free trial for 365 and see if that changes things.

    Appreciate your help

  25. #25
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,598

    Re: Getting #NAME error when trying to call a function

    Do other macros and/or VBA User Defined Functions work in this workbook? See rorya's post #23.

  26. #26
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,237

    Re: Getting #NAME error when trying to call a function

    TMS, it is possible that MS does not tell us everything. Look here.
    Just in case, an excerpt from the site:
    Most dynamic array formulas (but not all!) will keep displaying their results in legacy Excel until you make any changes to them. Editing a formula immediately breaks it and displays one or more #NAME? error values.
    the creeker, probably in your version you can use this function as an array formula (Shift + Ctrl + Enter). Select the multi-cell range (from top to bottom), press [F2], enter the formula and arguments into the first cell and press Shift + Ctrl + Enter.

    The problem is that you don't know how many cells to select. Therefore, I have prepared a procedure for you that will do it for you.
    Usage:
    1. Select the cell from which to start inserting the array formula. Make sure that the range below this cell is empty as existing values will be overwritten.
    2. Run the LaunchMyFormula macro and enter two arguments separated by a semicolon ( ; ).

    Reading previous posts, it comes to my mind that you may have settings in Excel such that macros are disabled. You must then change to enable macros.

    Artik
    Attached Files Attached Files

  27. #27
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,152

    Re: Getting #NAME error when trying to call a function

    My Excel 2010 do not have the built-in SORT worksheet function, so I used "System.Collections.ArrayList" to sort the "steps" array and needed to transpose the array at the end, without making any other changes.

    Hence, it seems working on Excel 2010 (sample file is attached)


    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Haluk; 09-06-2021 at 10:27 AM.

  28. #28
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,237

    Re: Getting #NAME error when trying to call a function

    Note that .Net Framework version 3.5 is required to use ArrayList. You may have other versions, but without version 3.5 the ArrayList may not work properly.

    Artik

  29. #29
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,152

    Re: Getting #NAME error when trying to call a function

    I've .Net Framework 4.8 installed and "System.Collections.ArrayList" works fine.

    BTW, any other sorting routine can also be used if needed...

  30. #30
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,237

    Re: Getting #NAME error when trying to call a function

    Have you checked that you really don't have version 3.5 installed? As I mentioned, you can have several versions installed.

    Artik

  31. #31
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,152

    Re: Getting #NAME error when trying to call a function

    Yes, I really don't have .Net 3.5 installed.
    Attached Images Attached Images

  32. #32
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,152

    Re: Getting #NAME error when trying to call a function

    BTW, the registery editor shows that 3.5 is also installed....
    Attached Images Attached Images

  33. #33
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,152

    Re: Getting #NAME error when trying to call a function

    And this is another alternative in sorting the array where a very classical routine is used.

    (Sample workbook is also attached).

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files

  34. #34
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Getting #NAME error when trying to call a function

    For your information: Period Function 2 and 3 work fine here, Excel 2016 32-but on W10 64-bit

  35. #35
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,152

    Re: Getting #NAME error when trying to call a function

    Keebellah, thanks for the information.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Log function Runtime Error '5': Invalid procedure call or argument
    By asaiz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2019, 04:31 AM
  2. [SOLVED] Runtime Error! R6025 -pure virtual function call
    By STINEHART in forum Excel General
    Replies: 3
    Last Post: 05-20-2018, 02:55 AM
  3. [SOLVED] Best way to handle if error with call function
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-21-2013, 08:00 AM
  4. [SOLVED] Getting an error when trying to call a function from a sub, with string value of cell
    By RebelScum in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-21-2012, 06:21 AM
  5. [SOLVED] Function Call on left-hand side... error
    By SeanDamnit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 07:08 AM
  6. Call a function on error
    By Niandler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2010, 04:30 PM
  7. error 28: out of stack space call function
    By ina in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-24-2006, 02:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1