NetOfficeFw / NetOffice

🌌 Create add-ins and automation code for Microsoft Office applications.
MIT License
697 stars 143 forks source link

Group method for Range fails with MethodCOMException #328

Closed IainDM closed 3 years ago

IainDM commented 3 years ago

Hi

I am trying to group 5 rows on a worksheet - let's say rows 6-10. I use Range("A6:A10").EntireRow.Group(). This works just fine using InterOp but fails with a MethodCOMException using NetOffice.

From the source, it looks like only the Group methods for PivotTables are implemented. Is this right?

Thanks!

samatstariongroup commented 3 years ago

I typically use the OutlineLevel property to apply grouping. Your code should look something like Range("A6:A10").EntireRow.OutlineLevel = 1.

IainDM commented 3 years ago

thanks!