Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Wrl233 opened this issue Apr 30, 2024 · 6 comments

Comments

@Wrl233
Copy link

Wrl233 commented Apr 30, 2024

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
Copy link

flaviu22 commented Apr 30, 2024

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
Copy link

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
Copy link
Author

Wrl233 commented Apr 30, 2024

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
Copy link

Sure, here is my email: [email protected]

@flaviu22
Copy link

flaviu22 commented May 7, 2024

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
Copy link

flaviu22 commented May 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants