DataRange::GetBookSheet is used to get book and sheet name of the index-th x range, please refer to :
http://ocwiki.originlab.com/index.php?title=OriginC:DataRange-GetBookSheet
In your case, there is no X range specified in dataplot, so GetBookSheet will not work. X range is considered as valid subrange for regular datarange. However, for XYRange, it makes more sense to use Y. We will fix it with 81SR2, #15157.
As a workaround for now, maybe you can try this :
BOOL GetBookSheetFromDataPlot(string& strBook, string& strSheet, const DataPlot& dp)
{
string strRange;
dp.GetRangeString(strRange, NTYPE_BOOKSHEET_XY_RANGE);
return okutil_get_book_sheet_info(&strBook, &strSheet, strRange);
}
Originlab Corp.
There is always something