tfussell / xlnt

:bar_chart: Cross-platform user-friendly xlsx library for C++11+
Other
1.43k stars 402 forks source link

throws exception when I use load function to load an xlsx file containing functions #734

Open Wrl233 opened 2 months ago

Wrl233 commented 2 months ago

I installed XLNT 1.5.0#4 using VCPKG , but it throws exception when I use load function to load an xlsx file containing functions. the code: find_package(Xlnt REQUIRED) target_link_libraries(${PROJECT_NAME} PRIVATE xlnt::xlnt) But when I git clone the latest commit from the master branch and compile the XLNT library by myself withous using VCPKG ,it support xlsx file containing functions.Is it because VCPKG has not updated the latest version of the XLNT library?

flaviu22 commented 2 months ago

It would simpler if you compile the current code instead of take it from vcpkg. You can do it simpler by:

  1. clone the latest code: git clone --recurse-submodules https://github.com/tfussell/xlnt.git
  2. Open CMake and compile it:

image

Generate solution file and compile it with your compiler.

If you need, I can send you the project, compiled, just give you email address.

flaviu22 commented 2 months ago

If you have issues at the first step, call:

git config --global http.sslVerify false
git clone --recurse-submodules https://github.com/tfussell/xlnt.git
git config --global http.sslVerify true
Wrl233 commented 2 months ago

Thanks a lot. I compile the current code instead of take it from vcpkg and it run successfully. But i don't know why it run successfully and i guess the XLNT version code in VCPKG is older than the current code. You can try this.

  1. Generate a xlsx file with using RANDBETWEEN function ,like RANDBETWEEN(1350,1650).
  2. Use load function of XLNT to read this xlsx file.
  3. Compare VCPKG and Compiled by self in using XLNT. My question can be reproduced through the above methods.If you want my source code ,tell me your email address.
flaviu22 commented 2 months ago

Sure, here is my email: flaviu2@yahoo.com

flaviu22 commented 2 months ago

Thanks a lot. I compile the current code instead of take it from vcpkg and it run successfully. But i don't know why it run successfully and i guess the XLNT version code in VCPKG is older than the current code. You can try this.

  1. Generate a xlsx file with using RANDBETWEEN function ,like RANDBETWEEN(1350,1650).
  2. Use load function of XLNT to read this xlsx file.
  3. Compare VCPKG and Compiled by self in using XLNT. My question can be reproduced through the above methods.If you want my source code ,tell me your email address.

Hi, did you solve the problem? Have you sent your email?

Anyway, I have tried what you said, something like this:

        auto ws = wb.active_sheet();
        ws.cell("A1").value(5);
        ws.cell("C4").value("RANDBETWEEN(1350, 1650)");
        wb.save("c:/transfer/example.xlsx");

And worked fine ... I might miss something, can you detail your issue?

flaviu22 commented 2 months ago

Also, I can send my compiled library, if you want ...