Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Sat Jan 17, 2026 5:30 pm

Here is my code. Columns 2 is a Date and column 3 is a time.

Console.WriteLine("Sorting");

CellRange rangeSrt = sheetTmp.Range["A1:Z" + sheetTmp.LastDataRow.ToString()];

// Sort sheet.
//shtTmp.DataSorter.SortColumns.Clear();

//shtTmp.DataSorter.SortColumns.Add(11, SortComparsionType.Values, OrderBy.Ascending);
shtTmp.DataSorter.SortColumns.Add(0, SortComparsionType.Values, OrderBy.Ascending);
shtTmp.DataSorter.SortColumns.Add(2, SortComparsionType.Values, OrderBy.Ascending);
shtTmp.DataSorter.SortColumns.Add(3, SortComparsionType.Values, OrderBy.Ascending);

shtTmp.DataSorter.IsIncludeTitle = true;

//Console.WriteLine(sheetTmp.LastDataRow.ToString().Trim());

//Set the range to sort
shtTmp.DataSorter.Sort(rangeSrt);

trozzi1957
 
Posts: 14
Joined: Sun Oct 14, 2018 10:58 pm

Mon Jan 19, 2026 1:55 am

Hello,

Sorry for the delayed response due to the weekend on our end.
Did you happen to send an email to our mailbox as well? My colleague had previously replied to you, but the message was rejected (as shown in the screenshot). Could you please check whether your email has any specific settings that might be blocking our emails? Thanks in advance.
Regarding the sorting issue you encountered, we have logged this issue in our tracking system under reference number SPIREXLS-6065. We will notify you promptly once the issue is resolved. We sincerely apologize for the inconvenience this has caused you.
Attachments
reject.png
reject.png (1.07 MiB) Viewed 25 times
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Tue Jan 20, 2026 2:01 am

Hello,

Thank you for your patience.
Regarding issue SPIREXLS-6065, our investigation has identified three potential workarounds:
1. Adjust the sorting range to start from row 1:
Code: Select all
CellRange rangeSrt = sheetTmp.Range[1, 1, sheetTmp.LastDataRow, sheetTmp.LastDataColumn];

2. Place this line before or after defining your CellRange( CellRange rangeSrt = sheetTmp.Range[2, 1, sheetTmp.LastDataRow, sheetTmp.LastDataColumn];)
Code: Select all
shtTmp.DataSorter.SortColumns.Clear();

3. Set IsIncludeTitle to false, and place this line before or after defining your CellRange(CellRange rangeSrt = sheetTmp.Range[2, 1, sheetTmp.LastDataRow, sheetTmp.LastDataColumn];)
Code: Select all
shtTmp.DataSorter.IsIncludeTitle = false;

Please select the most suitable option and test. We look forward to your feedback.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Tue Jan 20, 2026 3:47 pm

Hi-

Workaround seems to work. Will monitor.

-Thomas

trozzi1957
 
Posts: 14
Joined: Sun Oct 14, 2018 10:58 pm

Wed Jan 21, 2026 1:46 am

Dear Thomas,

Thanks for your feedback.
If you need assistance during this time, please do not hesitate to reach out. Wish you a nice day.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Return to Spire.XLS