The range=sheet. Get_Range (COleVariant (_mark), covOptional);
If only one sheet, I can find the location of the label corresponding with the above statements, the tag name _mark,
But now I'm Excel have more than one sheet, I don't know _mark is inside the sheet a few,
If I direct
The range of=sheet1. Get_Range (COleVariant (_mark), covOptional);
_mark is not in sheet1, will jump went wrong at this moment, so I don't know how to traverse the find,
What I want is: according to the label name _mark find its location in the multiple sheet, consult everybody a great god what to do? Thank you for
CodePudding user response:
SheetsPtr m_pSheets=pWorkbook - & gt; Worksheets.
For (long iSheet=1; ISheet{
_WorksheetPtr pSheet=m_pSheets - & gt; The GetItem (iSheet);
PSheet - & gt; Activate ();
Try
{
RangePtr pRange=pSheet - & gt; The Range of [_mark];
If (pRange)
{
}
}
The catch (_com_error & amp; E)
{
}
}
CodePudding user response: