Spire.XLS is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Wed Dec 15, 2021 11:56 pm

I've been trying to set the column width of the second column. However, it doesn't work. I can set the first column but not other columns width.

This works:
sheet.SetColumnWidth(1, 30);

This does not work:
sheet.SetColumnWidth(2, 80);

Any ideas?

surfdmountain
 
Posts: 8
Joined: Wed Dec 15, 2021 9:49 pm

Thu Dec 16, 2021 3:23 am

Hello,

Thank you for your inquiry.
I tested your code, but did not reproduce your issue. The version I used is the latest version(Spire.XLS Pack(Hotfix) Version:11.11.2). If you were not using the latest version, please first give it a try. If the issue still exists after trying, please provide the following information for our reference. You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
1)Your sample Excel file.
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
3) Your application type, such as Console app (. Net Framework 4.5).

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1101
Joined: Wed Apr 07, 2021 2:50 am

Thu Dec 16, 2021 8:09 pm

I'm using FreeSpire.XLS version 11.8.6
Will the hotfix work for this version?

surfdmountain
 
Posts: 8
Joined: Wed Dec 15, 2021 9:49 pm

Fri Dec 17, 2021 1:54 am

Hello,

Thank you for your feedback.
I tested your code again with the Free Spire.XLS version 11.8.6, but still did not reproduce your issue. For your situation, I still suggest that you use the commercial version (the latest version is Spire.XLS Pack (Hotfix) Version: 11.12.2) to test again. If the issue still exists after the test, please provide the following information for our reference. You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
1)Your sample Excel file.
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
3) Your application type, such as Console app (. Net Framework 4.5).

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1101
Joined: Wed Apr 07, 2021 2:50 am

Fri Dec 17, 2021 2:54 am

There was an error in my code. I have the columns working now! Sorry for the fuss!

surfdmountain
 
Posts: 8
Joined: Wed Dec 15, 2021 9:49 pm

Fri Dec 17, 2021 3:27 am

Hi,

Glad to hear that you solved the issue.
If you encounter other issues related to our products in the future, please feel free to contact us.
Wish you all the best!

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1101
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS