Excel add-in: Excel.CustomFunctionDimensionality.matrix is not a recognized type

174 views Asked by At

So, I'm trying to create a custom function that takes a range as a parameter, and I'm following the example here: https://learn.microsoft.com/en-us/office/dev/add-ins/excel/custom-functions-parameter-options?tabs=javascript#range-parameters - According to this, passing in a range SHOULD pass the data in as a 2D matrix, which would be ideal.

However, I'm using TypeScript, and it doesn't seem like Excel.CustomFunctionDimensionality.matrix (which is what the guide said the type is) is a valid type. In fact, it can't even find "CustomFunctionDimensionality" (and I can't find references to it anywhere else in the documentation). I've tried using any[][], but that doesn't seem to work. Either way, I get #CALC! errors when trying to pass in a range, due to an "unliftable array" I assume this is because it doesn't know that a range is a valid data type for my function, but I'm not sure.

As a workaround, I let this param be a string, and pass the range address in as a string, and manually grab the data in my function, but this is clunky and counter-intuitive, so I'd really like to get this fixed.

for context, my function declaration looks like this:

export function distinct(range: string | any[][]): Promise<number>

0

There are 0 answers