View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 788
Default UDF is not executing

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

"Gary Brown" wrote:

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!
--
Sincerely,
Gary Brown


"Chris" wrote:

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

"Gary Brown" wrote:

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


"Chris" wrote:

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,