We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Setting Range.RowHeight has no effect

When I tried to set the row height by forming a range encompassing the row, it had no effect. Setting the ColumnWidth property through the range object worked fine.

// Works

// Doesn’t work

// Works

I’ll use the Cells.SetRowHeight method instead, as this works okay. Any thoughts on why Range.RowHeight has no effect?



Dear Josh,

Please download fix 1.8.5 and have a try.

Aspose.Excel is discontinued now and is replaced with Aspose.Cells which contains all the latest features along with the support to the features provided by Aspose.Excel. Row height and column height can be set using this new product as follows:

string InputPath = dataDir + "Book1.xlsx";

// Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream(InputPath, FileMode.Open);

// Opening the Excel file through the file stream
Workbook workbook = new Workbook(fstream);

// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];

// Auto-fitting the 3rd row of the worksheet
worksheet.AutoFitRow(1, 0, 5);

// Saving the modified Excel file
workbook.Save(dataDir  + "output.xlsx");

// Closing the file stream to free all resources

For more details on adjusting row height / column width and AutoFit rows and columns, follow the link below:
AutoFit Rows and Columns

The latest version of this product can be downloaded from the following link:
Aspose.Cells for .NET (Latest Version)

A running project with a bunch of examples can be downloaded here here.