ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array formulas cannot return strings longer than 255 (https://www.excelbanter.com/excel-programming/407255-array-formulas-cannot-return-strings-longer-than-255-a.html)

Alok[_2_]

Array formulas cannot return strings longer than 255
 
Array functions, even in Excel 2007, seem to be limited to returning
strings shorter than 255 characters. To see this, enter the following
function as an array formula:

Public Function HOHO() As Variant
Dim v As Variant
ReDim v(2, 2)
v(0, 1) = "HOHO"
v(1, 1) = String(256, "a")
HOHO = v
End Function

Is there any way around this error?

Thanks,
Alok

Peter T

Array formulas cannot return strings longer than 255
 
Pretty sure I recall seeing this "limitation" documented in an MS KB
article. Need to workaround, at the very least truncate any 255+ strings in
a array returned to a UDF. Perhaps place the excess into additional
element(s) of the array.

Regards,
Peter T

"Alok" wrote in message
...
Array functions, even in Excel 2007, seem to be limited to returning
strings shorter than 255 characters. To see this, enter the following
function as an array formula:

Public Function HOHO() As Variant
Dim v As Variant
ReDim v(2, 2)
v(0, 1) = "HOHO"
v(1, 1) = String(256, "a")
HOHO = v
End Function

Is there any way around this error?

Thanks,
Alok





All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com