Collapse group
You can collapse a group by setting the ShowDetail property of the IRange interface to boolean false. Refer to the following example code to collapse a group in a worksheet.