Hi, I am working on excell Add-in in c++. Say for example...I have following function.. LPXLOPER __stdcall setOrcYieldCurve(LPSTR yieldCurveName, LPSTR ccy, LPXLOPER sourceCellRange) { return NULL; } I want go get value of each and every cell of "sourceCellRange". Could any one help me? Thanks in advance. Regards, Sunil Adhyaru. url:http://www.ureader.com/gp/1039-1.aspx
The answer depends on how you are registering your function. If the 3rd argument is registered as type R then a range reference in the spreadsheet will be passed to you as is, (i.e. either xltypeRef or xltypeSRef) and you will have to convert it to an array-type XLOPER (xltypeMulti) using xlCoerce. If you register the argument as type P then Excel will convert a passed-in reference to an xltypeMulti for you. (In either case you should check that you were not passed an inappropriate argument type, or one that your code could not deal with). Once you have an xltypeMulti XLOPER to deal with, you only need to iterate through the row-major array of XLOPERs and retrieve their values according to each element's type. Regards Steve Dalton "suniladhyaru" wrote in message news:5f05720214ae4dfd856da2119bb22228@newspe.com... > Hi, > > I am working on excell Add-in in c++. > > Say for example...I have following function.. > > LPXLOPER __stdcall setOrcYieldCurve(LPSTR yieldCurveName, LPSTR ccy, > LPXLOPER sourceCellRange) > { > > return NULL; > > } > > I want go get value of each and every cell of "sourceCellRange". > > Could any one help me? > > Thanks in advance. > > Regards, > Sunil Adhyaru. > > url:http://www.ureader.com/gp/1039-1.aspx