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

Free Support Forum - aspose.com

AutoFitColumn with a fixed range


We are trying to Autofit columns based a specific range i.e. a table’s range. However the AutoFitColumns() method doesn’t have an overload that takes a range and an AutoFitterOption object.
Is there a reason why this is the case?

AutoFitColumns Overloads:
AutoFitColumns(AutoFitterOptions options)
AutoFitColumns(int firstColumn, int lastColumn)
AutoFitColumns(int firstColumn, int lastColumn, AutoFitterOptions options)
AutoFitColumns(int firstRow, int firstColumn, int lastRow, int lastColumn)

Why isn’t there an “AutoFitColumns(int firstRow, int firstColumn, int lastRow, int lastColumn, AutoFitterOptions options)” overload?

I asked because we don’t want the autofitcolumns method basing the width on an external cell (from a table) which could have content much longer than values in the table. If we opt for the option where we provide a range, we would end up revealing hidden columns, which is undesirable in our cases.

Is there any workaround that will allow us to keep our hidden columns hidden and auto fit only base on range. Suggestions would very much be appreciated if an overload isn’t coming in the future.

Thank you


Thanks for providing us the details.

We need to evaluate if we could add an overloaded method, i.e…, AutoFitColumns(int firstRow, int firstColumn, int lastRow, int lastColumn, AutoFitterOptions options)

I have logged a ticket for your feature request with an id “CELLSNET-41589” as per your demand.

We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.


Thanks for your posting and using Aspose.Cells for .NET.

We have fixed the issue.

Please download and try this fix: Aspose.Cells for .NET v7.4.2.5 and let us know your feedback.


Thank you very much for providing a quick update.

The issues you have found earlier (filed as CELLSNET-41589) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.