Multiple Arrays in a Cell

39 views
Skip to first unread message

Joshua Wilder

unread,
Jun 9, 2025, 2:23:50 PMJun 9
to Excel-DNA
I'm trying to build dynamic strings using arrays. My issue is that arrays of different lengths are causing ExcelErroNA values to be passed in. Anyway around this?

eg) =SayHello("Hello"&F1:F5&"WORLD"&G1:G6) => item [6,1] is "ExcelErrorNA"

Thanks so much!
Josh

Govert van Drimmelen

unread,
Jun 9, 2025, 2:38:32 PMJun 9
to exce...@googlegroups.com

Hi Josh,

 

I see the same #N/A error from a sheet function

 

 

and also a VBA function.

 

Function SayHello(strArr)

    SayHello = strArr(6, 1)

End Function

 

I think what you’re seeing is the behaviour of the ‘&’ operator when there are mismatched array lengths.

By the time your Excel-DNA function gets this input, it will be a single object[,] array.

 

What would you like to see in item [6,1] of that array?

You could scan for the error value and replace with nulls of empty strings (provided you don’t want to see real #N/A values appearing in the input).

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/exceldna/4fcf437d-7e5f-455f-b5eb-ad0b0f68eb74n%40googlegroups.com.

image001.png

Joshua Wilder

unread,
Jun 9, 2025, 3:02:24 PMJun 9
to Excel-DNA
You're a rockstar as always! Thanks!
Reply all
Reply to author
Forward
0 new messages