Hello,
Does anyone have any experience using Range::Sort from the
Excel type library ?
I need to sort all the data using column A ascending as the
first key.
Here is a code snippet of what I've done so far:
//Common OLE variants. Easy variants to use for
//calling arguments
COleVariant
covTrue((short)TRUE),
covFalse((short)FALSE),
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
CString strCol1;
strCol1.Format("A%d", iStartRow);
lpDisp = sheet.GetRange(COleVariant(strCol1), COleVariant(strCol2));
ASSERT(lpDisp);
range.AttachDispatch(lpDisp);
range.Sort(COleVariant((CString)strCol1), 1,
covOptional,
covOptional,
0,
covOptional,
0,
0, covOptional, covOptional,
1,
1,
covOptional,
covOptional,
covOptional);
I keep getting an error using these parameters.
Does anyone know what each parameter means ?
(I haven't found any documentation on this).
Any help is greatly appreciated.
Thanks.
Does anyone have any experience using Range::Sort from the
Excel type library ?
I need to sort all the data using column A ascending as the
first key.
Here is a code snippet of what I've done so far:
//Common OLE variants. Easy variants to use for
//calling arguments
COleVariant
covTrue((short)TRUE),
covFalse((short)FALSE),
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
CString strCol1;
strCol1.Format("A%d", iStartRow);
lpDisp = sheet.GetRange(COleVariant(strCol1), COleVariant(strCol2));
ASSERT(lpDisp);
range.AttachDispatch(lpDisp);
range.Sort(COleVariant((CString)strCol1), 1,
covOptional,
covOptional,
0,
covOptional,
0,
0, covOptional, covOptional,
1,
1,
covOptional,
covOptional,
covOptional);
I keep getting an error using these parameters.
Does anyone know what each parameter means ?
(I haven't found any documentation on this).
Any help is greatly appreciated.
Thanks.