I am having a problem with the AutoFitRow() method. When I open the created Excel file, the rows are not auto-fit. I am using version 2.4.0.0. Here is my code:
@clchris,
Aspose.Excel is no more available now and is not under active development now. It is replaced with a new product Aspose.Cells which contains all the features of its predecessor along with the support of the latest features in different versions of MS Excel. Following example demonstrates the AutoFitRow function:
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
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);
// Saving the modified Excel file
workbook.Save(dataDir + "output.xlsx");
// Closing the file stream to free all resources
fstream.Close();
Here is a detailed article which provides description and examples of auto fitting the rows, columns, ranges and merged cells: AutoFit Rows and Columns