View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default UDF Can't return more than 255 chars???

On 30 Jun 2006 09:53:06 -0700, "R Avery" wrote:

Private Const NUM_CHARS As Long = 100

Public Function HOHO() As Variant
Dim v
ReDim v(0, 0) As Variant
v(0, 0) = String$(NUM_CHARS, "a")
HOHO = v
End Function

Public Function HOHO2() As Variant
Dim v As Variant
v = String$(NUM_CHARS, "a")

HOHO2 = v
End Function


If you specify the member of the array, it seems to work OK.

In other words, in function1:

HOHO = v(0,0)


--ron