简体   繁体   中英

Check on grouped rows in excel with c#

Like the title says, I don't know how to check on a row which is grouped. I Googled it, but couldn't find anything.

this code here doesn't work:

if (((Excel.Range)sourceRange.Rows[i]).Group() == true)   // doesn't work
{
     ...
}

Does somebody know how to check a row if it is grouped or not?

You can query the property OutlineLevel of the Range object. If the value is 1 it is not grouped. Greater values mean that the region is in a (eventually nested) group.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM