Free Support Forum - aspose.com

Changing Row Height

I’m getting an error when I try to change the height of the very first row on the spreadsheet (i.e. row index = 0). However, I can change the height of all subsequent rows. Here’s a sample of my code and the error msg it generated. I appreciate any help you can provide. Thanks in advance.

'change height of 1st row
Dim objSheet As Worksheet = objExcel.Worksheets.GetAt(0)
Dim objCells As cells = objSheet.Cells
objCells.SetRowHeight(0, 40)

Error msg received: System.InvalidOperationException: Specified IComparer threw an exception. —> System.ArgumentException: Object must be of type UInt16. at System.UInt16.CompareTo(Object value) at System.Collections.Comparer.Compare(Object a, Object b) at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer) — End of inner exception stack trace — at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer) at System.Collections.SortedList.IndexOfKey(Object key) at System.Collections.SortedList.get_Item(Object key) at Aspose.Excel.Cells.SetRowHeight(Int32 row, Int32 height)

Dear Spooger,

Thanks for your consideration.

It will be ok if you download the latest hot fix and replace the installed Aspose.Excel.dll with it.

Please accept my personal apology for any inconvenience you may have experienced.

Thanks for the updated zip file. I used the new dll but still got the same error. Any idea why?

System.InvalidOperationException: Specified IComparer threw an exception. —> System.ArgumentException: Object must be of type UInt16. at System.UInt16.CompareTo(Object value) at System.Collections.Comparer.Compare(Object a, Object b) at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer) — End of inner exception stack trace — at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer) at System.Collections.SortedList.IndexOfKey(Object key) at System.Collections.SortedList.get_Item(Object key) at Aspose.Excel.Cells.SetRowHeight(Int32 row, Int32 height)

Dear Spooger,

Have you made sure your Visual Basic project in Visual Studio .net refer to the latest Aspose.Excel.dll?

Please double check it and let me know what happens.

Yes. I’m sure. I replaced it in my bin folder. I know that I’m using the new dll because the parameters for a couple of other methods have changed (i.e. freezepanes).


Dear Sponger,

We have found it is a bug and plan to give you a hot fix around May 20.

Is it too late for you?

That’ll be fine, thanks!


Dear Sponger,

Good news!

The bug you have reported is fixed.

Please download the latest fix to replace the installed Aspose.Excel.dll.

Aslo as we introduce news classes, such as Comment and Comments, please consult the Aspose.Excel.htm included in the zip for the latest API Reference.

Dear Sponger,

What are you thinking about the evluation?

Do you have any problems about tech, licensing or payment?

we like aspose.excel and will invest in at least 2 copies of webform enterprise edition and 1 webserver enterprise edition. thanks for your help during our evaluation period.


Dear Sponger,

You’re welcome!

We’re always ready here for you.