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.

Tue Apr 20, 2021 12:45 pm

Hi, when trying to convert a .csv file to xlsx, the following line produces an error "BH2194 String length max than 32K" where 2194 is the number of rows in the csv file.
workbook.LoadFromFile(pSourceFile, ",", 1, 1)
I am using the latest version.
Any assistance appreciated.
Chris
Attachments
ice.zip
this is the data file
(302.16 KiB) Downloaded 465 times

chrisguest
 
Posts: 7
Joined: Wed Jun 17, 2020 8:49 am

Wed Apr 21, 2021 3:56 am

Hello Chris,

Thanks for your inquiry.
I did an initial test with your input file, but I did not reproduce your issue. To help us investigate further and solve your issue, please provide your OS information (e.g. Windows7, 64bit) and your region setting (e.g. China, Chinese). Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri Apr 23, 2021 8:39 am

Hi Brian
I'm on Windows 10 Version 21H1 OS Build 19043.928 64 bit. Region is Australia.

chrisguest
 
Posts: 7
Joined: Wed Jun 17, 2020 8:49 am

Fri Apr 23, 2021 11:46 am

Hello,

Thank for your feedback.
I tested your case in a similar environment but I still did not encounter any issue. Here I uploaded my.exe file. Please click the "xls.exe" file to run it directly on your side and then let us know your result. Looking forward to your feedback.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Sat Apr 24, 2021 5:21 am

Hi
Your executable works. However, I still get the error on trying to load from file as shown in the screenshot from Visual Studio when my code runs.
ice.PNG
ice.PNG (13.46 KiB) Viewed 1030 times

chrisguest
 
Posts: 7
Joined: Wed Jun 17, 2020 8:49 am

Sat Apr 24, 2021 8:19 am

Hi Again
Interesting - when I add an empty try/catch block, the error still happens, but the subsequent code gets executed and the workbook can be formatted - this solves my immediate problem, but it would be good to know why the error is thrown:
Code: Select all
Try
            workbook.LoadFromFile(pSourceFile, ",", 1, 1)

        Catch ex As Exception

        End Try

chrisguest
 
Posts: 7
Joined: Wed Jun 17, 2020 8:49 am

Sun Apr 25, 2021 2:38 am

Hello,

Thanks for your feedback.
To help us reproduce your issue so that we can locate the cause of this issue, could you please provide us with your runnable project? You could upload it to the DropBox or OneDrive and then share the download link with us. Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Apr 28, 2021 9:33 am

Hello,

Has your issue been resolved? If not, could you please provide your runnable project to us for further investigation?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.XLS