TryCollapseOrExpandAllGroups ( Microsoft.Office.Interop.Excel.Workbook oWorkbook, Boolean bCollapse ) { Debug.Assert(oWorkbook != null); // Store the new collapsed state in the group table. ListObject oGroupTable; if (ExcelTableUtil.TryGetTable(oWorkbook, WorksheetNames.Groups, TableNames.Groups, out oGroupTable)) { ExcelTableUtil.SetVisibleTableColumnData(oGroupTable, GroupTableColumnNames.Collapsed, (new BooleanConverter()).GraphToWorkbook(bCollapse)); return(true); } return(false); }