LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default UDF - 256-Char - UDF = "#VALUE!"

Hi Greg
I experience the same as you - no surprises! (XP / Excel 2003)

I can pass a 32767 (integer max) string as a parameter into a udf, and
create the same length string into a cell (documented max). But not nested
in the way you describe - very curious - must be a limit somewhere??

--
Cheers
Nigel



"Greg Lovern" wrote in message
ups.com...
If I create a UDF that returns a string longer than 255 characters, and
another UDF that accepts and returns a string, they work fine together
in separate worksheet cells, but if I nest the former in the latter in
a single formula, it returns "#VALUE!".

I've searched newsgroups and Microsoft's support site, and although I
see many articles that discuss various limitations of 255 with Excel,
none seem to address this particular problem.


Here are the test UDFs:

Function myUDF_MakeBig(length As Long) As String
myUDF_MakeBig = String(length, "a")
End Function

Function myUDF_GetBig(text As String) As String
myUDF_GetBig = text
End Function


Here are the worksheet formulas, with their return values:

=myUDF_MakeBig(256) <--This is in cell A1.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaa

=myUDF_GetBig(A1)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaa


=myUDF_GetBig(myUDF_MakeBig(255))
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaa

=myUDF_GetBig(myUDF_MakeBig(256))
#VALUE!


Is this a bug or limitation? Is it documented anywhere?


Thanks,

Greg Lovern
http://PrecisionCalc.com
More Power In Excel



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get "####" when use alpha char in a cell referenced by a formula Leo Excel Worksheet Functions 5 January 8th 09 06:18 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
How to perform Search and Replace on "Tilde", CHAR(126), ~ [email protected] Excel Worksheet Functions 2 March 28th 07 06:57 PM
Macro crashes "Automation error" during copy of workbook with char Yorch Excel Programming 0 January 30th 06 09:09 PM
Problem in compiling code containing "$" char Alain79[_3_] Excel Programming 11 June 30th 05 10:07 AM


All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"