Using UDF with dynamic arrays and working around @

Copper Contributor

We have created a UDF (.xll plugin using ExcelDNA) so we can call into C# code. The UDF returns an array of double-precision numbers. We also write .xlsx files using various 3rd party components.

 

Because of the new versions supporting dynamic arrays, the formulas using our UDF get the implicit intersection operator applied to them, and that is preventing them from filling the cells next to them. Removing the operator manually allows the values to spill into the adjacent cells. An image of the behavior is attached.

 

The documentation on this feels ambiguous. In one document, it talks about writing to the Range.Formula2 property of cells. Given we're using 3rd party components to write the .xlsx, I'm not sure this is available. But other docs suggest that any UDF will get flagged with '@', so would it even matter?

 

Are there suggestions on how to work around this issue?

0 Replies