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.

Thu Mar 02, 2017 10:14 am

Hello

I have an issue when i try to load an Excel file with Formula =LEFT(B3, 1)

Code: Select all
string path = Chemin + "sample.xlsx";
var workbook = new Workbook();
workbook.LoadFromFile(path);
// Unexpected token.Unexpected token type: tInteger, string value:   at position 8. Formula: LEFT(B3,1), Position: 8


Do you know when this issue happens or do you have a bypass ?

Thanks
Attachments
sample.zip
(10.86 KiB) Downloaded 233 times

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Fri Mar 03, 2017 2:30 am

Dear VincentB,

Thanks for your inquiry.
Please try to set current culture to avoid this error.
Code: Select all
            CultureInfo cc = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            Workbook book = new Workbook();
            book.LoadFromFile(@"F:\Sample.xlsx");
            ...
            Thread.CurrentThread.CurrentCulture = cc;

If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Mar 03, 2017 8:22 am

Hello,

It works perfectly !!

Thanks

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Fri Mar 03, 2017 8:25 am

Dear VincentB,

Thanks for your feedback.
Please feel free to contact us if there is any question, we are here for help :) .

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.XLS