Setting AutoFitRows for merged cells when using template in C# .NET

I am using a template as shown in the attached screenshot in a C# app.

AsposeCells.jpg (58.1 KB)
AsposeCellsExcel.jpg (78.5 KB)

The last 3 rows are merged into one and each of the four cells shown are also merged to create 4 cells. Some data in those cells is set to word wrap. I have been trying to get that row to resize the row height based on the data going in. If there are more lines, I need the row height to increase to fit all of the data in the cells. The cells were formatted in the Excel template and you cannot set a merged row to Auto Height in excel.

I figure the only way to make this auto height would be in the C# code using the Aspose.Cells properties.

I have been banging my head against the wall trying to figure this out and I am at a lose. If anyone can help, please let me know ASAP.

Thanks in advance.

Mark

@macmmc
Excel defaults to ignore merged cells when fitting the row height. So Aspose.Cells works as MS Excel default.
Please set the type of fitting merged cells as the following codes:
AutoFitterOptions options = new AutoFitterOptions();
options.AutoFitMergedCellsType = AutoFitMergedCellsType.EachLine;
workbook.Worksheets[0].AutoFitRows(options);

Is this possible even if we are using an old version of Aspose.Cells? Here is the version and the error after trying your suggestion:

image.png (42.6 KB)

@macmmc,
It is always recommended to use the latest version. We are afraid that if an older version does not support a feature, then it is not possible to add it in the older versions. You may please upgrade your library to avail this feature.