Hi, I'm trying to write a custom spreadsheet function that interfaces to a function that requires arrays of doubles as input. I know I can assign a variant directly to a range, but as far as I know, to get the values to an array of doubles, I need to dimension the array of doubles, then copy the elements in a nested loop (m x n matrix) before passing the array to the function. The return is a 1d array of doubles, which means I need to copy the elements to a 2d array before it can be sent to the spreadsheet cells.

Basically, I'm looking for an easier way to get a range of numbers into an array of doubles and avoid all the allocating/copying back and forth. Any ideas?