How to fix this #VALUE error?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,676
Office Version
  1. 365
Platform
  1. Windows
In the minisheet below, I get a #VALUE error for the call to my GetFormula UDF that I have used for years. In an attempt to identify the error, I added a breakpoint.

1718654140101.png


It never got called. I wondered if in my migration of files from my old Win 10 laptop to my new Win 11 laptop, I might have made another copy of my add-in module which is where these UDFs are stored. But then I added a call to my GetFormat UDF which is right next to the GetFormula UDF in the same add-in module. That breakpoint was executed.

1718655125464.png


Why would one UDF in the same add-in module get executed and another one not? Is there a way I can find out what module the code is calling?

I ran several searches for "getformula(" in all of the active modules and got no hits.

I also found it puzzling that the call to GetFormula insisted on mixed case (that matches the declaration in the add-in module), but the call to getformat insists on all lower case, which does not match the declaration.

FormulaText.xlsx
CDE
53#VALUE!General
Cell Address
Cell Formulas
RangeFormula
C5C5=1+2
D5D5=GetFormula(C5)
E5E5=getformat(C5)
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
After a bit of checking, it appears that Name Manager is the cause of the problem. It must have a GetFormula function in it (albeit hidden) and presumably the declaration requires different parameters to the ones for your function, hence the #VALUE error.
 
Upvote 0
Solution
I have tested hiding the name in Name Manager and the function still works, so it not showing in name manager is not conclusive. However it sounds like you haven't experimented with using the Macro4 option as an alternative to a UDF so it would seem unlikely that there is a conflicting function in name manager.

The rest of the post was just in case it piqued your or any other visitors to the post's interest in having an alternative to a UDF for these functions. I do understand that you have it installed through and add-in and there are some benefits to using it that way.
I don't understand this post. What is "the Macro4 option"?
 
Upvote 0
After a bit of checking, it appears that Name Manager is the cause of the problem. It must have a GetFormula function in it (albeit hidden) and presumably the declaration requires different parameters to the ones for your function, hence the #VALUE error.

Brilliant! That's it. I disabled Name Manager and now my GetFormula works. Thank you! 👍👏😍

I am curious as to how you figured that out.

When you previously mentioned Name Manager, I thought you were referring to the one built into Excel not the add-in.

And now I am even more angry at MS$T. Are they too lazy or too stupid to issue a warning message if they encounter duplicate function names? D*mn! D*mn! Double D*mn! 🤬🤬🤬

PS: I am also a little annoyed at Name Manager (the add-in) for giving it the same name.
 
Upvote 0
This problem has cost me several hours of my time today and there is no solution. Things like this are happening more and more often. When they do, I literally hate M$FT. A good friend of mine recently switched to a Mac. She loves it. It just works. She doesn't write code, but I may have to look into that. 🤨😡🤬
I've been regularly disappointed in Microsoft over the last number of years. I feel the same way about Linux as your friend does about Mac.
 
Upvote 0
I am curious as to how you figured that out.

The code had to be in an add-in, since the function call didn’t include a workbook name and the workbook it was used in was not macro-enabled. Since you’d already checked your add-in and NM was the only other one loaded, I assumed it had to be that. I downloaded and installed it and could replicate the error then, which confirmed it.

When you previously mentioned Name Manager, I thought you were referring to the one built into Excel not the add-in.
That wasn’t me. ;)

If you write code, you would not enjoy Mac Excel. And it would still be Microsoft anyway.
 
Upvote 0
The code had to be in an add-in, since the function call didn’t include a workbook name and the workbook it was used in was not macro-enabled. Since you’d already checked your add-in and NM was the only other one loaded, I assumed it had to be that. I downloaded and installed it and could replicate the error then, which confirmed it.
Excellent detective work. 🙏

That wasn’t me. ;)
Post #14? (Re mentioning Name Manager) I meant the comment as a misunderstanding on my part, not as a criticism.

If you write code, you would not enjoy Mac Excel. And it would still be Microsoft anyway.
Yeah, that's what I figured. I am intrigued by Google Sheets, however.

Anyway, thanks very much for your many invaluable contributions to this group. 👏👏👏 This board has some amazingly knowledgeable and dedicated contributors.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top