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

xlnt throws exception while opening xlsx file #330

Open
shhccie opened this Issue Aug 4, 2018 · 4 comments

Comments

3 participants
@shhccie

shhccie commented Aug 4, 2018

while opening an xlsx file, xlnt throws:
"xlnt::exception : couldn't open file: (sizes don't match)"

this is the test program:

#include <xlnt/xlnt.hpp>

int main()
{
using namespace std;
using xlnt::workbook;

try {
    workbook wb;
    wb.load("a.xlsx");
}
catch (exception const& e) {
    cout << e.what() << '\n';
}

}

The file a.xlsx can be opened with MS Office 2007 without a problem.

I uses 32 bit Windows 7, and I downloaded xlnt from MSYS2. The compiler is GCC, also downloaded from there. Thanks!

@Crzyrndm

This comment has been minimized.

Collaborator

Crzyrndm commented Aug 5, 2018

Does this spreadsheet have any merged cells? Does it load if they are unmerged? (That exact exception is thrown in two different locations sadly -.-)

Do you which version of xlnt mysys2 is providing? (probably either 1.2 (late 2017) or 1.3 (last week))

@shhccie

This comment has been minimized.

shhccie commented Aug 5, 2018

Yes, the spreadsheet has some merged cells. It's a little bit complex, but I have just unmerged five merged cells which I found, with the same result. I tried to upload the file yesterday and now again, but without success. I can send the file by e-mail if you can give me some address.

The version of xlnt I'm using is 1.3, which I updated from MSYS2 only recently.

@shhccie

This comment has been minimized.

shhccie commented Aug 6, 2018

Using boost stacktrace:
#include <boost/stacktrace.hpp>
#include <xlnt/xlnt.hpp>

int main()
{
using namespace std;
using namespace boost::stacktrace;
using xlnt::workbook;

try {
    workbook wb;
    wb.load("a.xlsx");
}
catch (exception const& e) {
    cout << e.what() << '\n'
         << stacktrace() << '\n';
}

}

the program output is:
xlnt::exception : couldn't open file: (sizes don't match)
0# 0x0040C519 in E:\code\cpp.exam\Exam\bin\debug\Exam.exe
1# 0x0040138B in E:\code\cpp.exam\Exam\bin\debug\Exam.exe
2# 0x76B9EF8C in C:\Windows\system32\kernel32.dll
3# 0x7712367A in C:\Windows\SYSTEM32\ntdll.dll
4# 0x7712364D in C:\Windows\SYSTEM32\ntdll.dll

which doesn't seem to give more info than above.

@dongbum

This comment has been minimized.

dongbum commented Nov 21, 2018

I have the same problem while load .xlsx file.

xlnt::exception : couldn't open file: (sizes don't match)

I found that this problem occurs depending on whether or not one column is added. (In same .xlsx file.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment