Just remove
FindNext()
,
Instead used
Find()
twice :)
objFoundRng = objRange.Find(COleVariant(strSearchStr), VOptional,
xlValues, xlPart, xlByRows,
xlNext, vFalse, VOptional, VOptional);
if(objFoundRng != NULL){
CString strFirstFound = objFoundRng.GetAddress(vTrue, vTrue,
(long)1, VOptional, VOptional);
CString strNextFound = _T("");
while(strFirstFound != strNextFound){
objFoundRng = objFoundRng.Find(COleVariant(strSearchStr), VOptional,
xlValues, xlPart, xlByRows,
xlNext, vFalse, VOptional, VOptional);
strNextFound = objFoundRng.GetAddress(vTrue, vTrue,
(long)1, VOptional, VOptional);
}
}