UDF is not executing

C

Chris

I have an custom add-in that has a number of subroutines and UDFs. The
subroutines seem to run fine, but some UDFs are returning #VALUE.

At first I thought it was an error in the program so I set a break point on
the first line of code in the function to determine what the error might
be... however the code isn't making it there.

If I change the name of the function by adding an "a" to the front it works
fine.

Please help -- I have no idea where the conflict is.

Thanks in advance,
 
N

Niek Otten

Please post the code of your UDF, the formula with which it is called *and* the values of the arguments. Please check the types of
the arguments (ISTEXT(), ISNUMBER(), .....)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


|I have an custom add-in that has a number of subroutines and UDFs. The
| subroutines seem to run fine, but some UDFs are returning #VALUE.
|
| At first I thought it was an error in the program so I set a break point on
| the first line of code in the function to determine what the error might
| be... however the code isn't making it there.
|
| If I change the name of the function by adding an "a" to the front it works
| fine.
|
| Please help -- I have no idea where the conflict is.
|
| Thanks in advance,
 
G

Gary Brown

Besides what Niek has said, you may be calling your UDF an 'illegal' name
that Excel is already using. For example, creating a udf called 'TEXT' or
'FORMAT' or 'VLOOKUP' (i.e. reserved words) is not a good thing and will
bring unexpected results.
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown
 
C

Chris

Thanks... I've figured out where the problem is but now I need help fixing it.

The code I'm using includes functions I wrote in addition to functions that
were written by a previous co-worker. The co-worker went to the trouble of
creating a help file for some of his functions. The functions included in
the help file are the functions that aren't working (my functions and his
other "undocumented" functions work fine).

I can make any function work by changing the name of the function (so that
it isn't linked to the help file). For example, one of the functions is
called "TaxRate" -- if I change the function name to "aTaxRate" it works
fine.

Do you know what the issue might be?

Chris
 
G

Gary Brown

Sounds like a 'scope' thing where Excel is getting confused. Since changing
the name works, well....There ya go!
Nice work and have a great weekend!
 
C

Chris

I found the problem, so I thought I would close the loop.

The problem was that in Auto_Open routine had a call to the .HLP file...
however the name of the file was typed incorrectly -- and I think was not
caught in the error trapping. This "error" resulted in the UDFs not
recognized when called from an Excel SS.

Needle in the haystack.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top