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

Free Support Forum - aspose.com

Getting correct column width

I downloaded a trial version of ASPOSE to test its use for a client's product.

The product's goal is to read an XLS file created in Excel and reformat it using ASPOSE.

I ran a test case with the attached file. It has two columns, col A has default size and col B is extra wide.

However when I read column widths using the Cells.GetColumnWidth(col index) or Cells.GetColumnWidthPixel(col index), I get the same value for both columns. I expected column B to be larger. How do I get the correct column width?



PS. Here is the output from a debug session displaying widths of the two columns.






Which version you are using, kindly try the attached version. I tested your template file using your code with the attached version and it works fine to give 64 and 141 values respectively for the two columns i.e., A and B.

Thank you.

I still get the same values using the attached dll.

Can you include the code you are using to read the column size?



Hi Andrew,

Now that looks very strange as I get perfect results. I think you are not using the above version ( and still using some older version. Please make sure that you are using the above version (

Here is my testing code:

Workbook book = new Workbook();






If you still find the problem, could you create a simple and fresh console application to show the issue, zip it and post it here, we will check it soon.

Thank you.