I think that the "-1" you were seeing is just an untrapped status returned by the bit of code "$.workbooks.Close".

UNIQ() and QSORT() work only with single dimension arrays, so will never work with the two dimensional array that you are returning from ReadExcel2()

The simplest fix for you is to create a couple of single dimension arrays of the right size and copy each of the "columns" into them, after which you can pass them to UNIQ() / QSORT().

The complex solution is to update the UDFs to support multi-dimension arrays, but if you think about it a bit you'll realise that it's not what you want it to do - you actually want to treat the columns as seperate lists, so you might as well split them up.