Auto fit with formulas

When using Worksheet.AutoFitColumns() if the cell has a formula in it and the value is larger than the column width the column width isn’t adjusted properly. See attached file for an example.

Hi,

Please download the latest version: Aspose.Cells for .NET (Latest Version)

It is working fine. Please see the code below and the output file.

C#


string path = @“F:\Shak-Data-RW\Downloads\Example.xls”;


Workbook workbook = new Workbook(path);


workbook.Worksheets[0].AutoFitColumns();

workbook.Save(path + “.out.xls”, SaveFormat.Excel97To2003);


Hi,


I have tested your issue with the latest version/fix (attached), it works fine. I have also attached the output file here.

Sample code:
Workbook workbook = new Workbook(“e:\test2\Example.xls”);
Worksheet worksheet = workbook.Worksheets[0];
worksheet.AutoFitColumns();
workbook.Save(“e:\test2\autofitting_test.xls”);

Here is a file that I just generated with the latest download that you gave me. As you can see the problem is still there. If you would like I can send you the VB project that generated this file and you can see for yourself that this is not working correctly.

Hi,


Yes, please give us the sample project to reproduce the issue on our end, we will check your issue soon.

Thank you.