0

Is there a way i can work out the shapes of the arguments in excelDNA?

I know i can get the shape of the calling area using this:

        ExcelReference caller = (ExcelReference)XlCall.Excel(XlCall.xlfCaller);
        int rows = caller.RowLast - caller.RowFirst + 1;
        int cols = caller.ColumnLast - caller.ColumnFirst + 1;

but say i want to produce a table, and have it transpose the table, and have it check if the arguments are horizontal and vertical arrays, and then align the table appropriately - is there a way to do this (i'd rather not have an additional flag in the function)?

will
  • 10,260
  • 6
  • 46
  • 69
  • If the argument value is an object[,] or double[,] array, can't you just check the size of the array? Maybe you can refine the question a bit to show what information you don't have, but would like to know. – Govert Oct 30 '15 at 15:05
  • If i make the argument jsut an array, `double[]`, then i don't know if it's horizontal or vertical. are you saying that if i make it `[,]` then it will preserve it as row or column vector? – will Oct 30 '15 at 15:17
  • Yes, that should work. – Govert Oct 30 '15 at 16:41

0 Answers0