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

Free Support Forum - aspose.com

Wrong value for worksheet.getCells().getMaxColumn()

Please check that worksheet.getCells().getMaxColumn(), this API returns value as 2 which is wrong one for an excel file that I have uploaded. In this I have selected first row and merged all columns.

But when I select limited columns lets say 10 columns and merged them, then API returns proper value.

excelFile.zip (5.9 KB)

Any help from your side will be appreciated.

-Kapil Jaiswal

@kapil.jaiswal.1eq

Thanks for using Aspose APIs.

We were able to observe this issue as per your description and logged it in our database for investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will update you in this topic.

This issue has been logged as

  • CELLSJAVA-42683 - Worksheet.getCells().getMaxColumn() returns Wrong Value if Entire Row is Merged

@kapil.jaiswal.1eq

Thanks for using Aspose APIs.

Please use Cells.getMaxDisplayRange() to get Max Column. Please see this article for more help. It explains how to work with Maximum Display Range of worksheet.

Thanks for a quick reply. I will check it and let you know if it satisfies our criteria.