First of all; Thanks Keith for making your C++ Excel XLL Add-In libary available, I like the fact that it is small, clean and stand-alone while disposing of all the hassles related to Excel memory management and much of the type conversion mess! The library
is IMHO implemented according to best practice C++ standards and with exception safety in mind which makes it plug right in to my code. Good job!
Now, I have a question for the community: Have any of you experienced issues with the xlfSelection function?
My code looks like this:
OPERX selRef = ExcelX(xlfSelection);
OPERX selection = ExcelX(xlCoerce, selRef);
I found this text on another webpage somewhere:
_Using my XLL library you would get the xltypeMulti
corresponding to the selection using:
OPER x = Excel(xlCoerce, Excel(xlfSelection));
No memory leaks.An exception is throw if something fails.
Elements are accessed linearly using operator and 2d
But when I try my code with an entire column (or row) selected in Excel 2010 the first line returns a 'selRef' with selRef.xltype == xltypeErr.
Another strange thing is that if I select two cells in the sheet the first line returns a 'selRef' with selRef.xltype == xltypeRef (which is as expected) but the second line will give a 'selection' with selection.xltype == xltypeErr!
Anyone having ideas as to why this is happening?
One thing I noticed is that val.sref.count sometimes is != 1 even though it should always be one according to the documentation. I don't know if this might cause any issues though.
Thanks in advance for all help!