microsoft / python-in-excel

Python in Microsoft Excel
MIT License
490 stars 31 forks source link

Allow 3D references as argument to xl method #37

Open ncalm opened 9 months ago

ncalm commented 9 months ago

It would be incredibly useful to be able to pass 3D references into the xl method.

Suppose you have some data in B2:K11 on each of sheets 1, 2 and 3.

We might have a 3D reference:

Sheet1:Sheet3!B2:K11

The xl method currently doesn't allow this type of reference.

It would be useful to be able to create one of the following from such a reference:

I'm sure all of this is possible by passing a callback to excel.set_xl_array_conversion, but the issue is that the xl method doesn't recognize 3D arrays at all, so it's not possible.

keyur32 commented 9 months ago

Thanks for this @ncalm! Yes, we currently do not support this behavior so would be interested, so don't have an ETA.

There are some not-great workarounds, for example putting your references into data frames (or whatever object you have overridden in your conversion functions). And then combining them in a subsequent python cell.