Serving the Quantitative Finance Community

 
User avatar
FidesFidelitas
Topic Author
Posts: 0
Joined: January 9th, 2012, 7:07 am

Help w XLW, getting the ref problem.

October 25th, 2012, 12:12 pm

Hi all,I've been stuck on this silly problem for almost a day now, and am about to give up. I'm trying to get the address of the input range and nothing works for me:xlw::XlfOper4 pxRes;xlw::XlfExcel::Instance().Call4(xlfCaller,(LPXLOPER)pxRes,0);XlfRef pxRef = pxRes.AsRef();std::string refA1 = pxRef.GetTextA1(); // This works fine!XlfOper a(inputRange);XlfRef r = a.AsRef();//XlfRef r(a.AsRef());//XlfRef r(a.AsRef("object")); // Does not work!When debuggin it fails to convert my XlfOper to XlfRef regardless of what I do. I'm using Excel 2003, xlw 5.0.0a2 and VS2010 if it matters. I'm sure it's easy, but I just don't see it. Any suggestion is more than welcome.
 
User avatar
adcockj
Posts: 1
Joined: July 14th, 2002, 3:00 am

Help w XLW, getting the ref problem.

November 26th, 2012, 7:27 pm

To get the address of the input the parameter, the type of the parameter at registration needs to be XLF_LPOPER rather than XLF_OPER, that way it's not converted into an array before it gets to the function and stays as a reference to the location of the data.John