Problem on Saving with openpyxl (python) and Loading with XSSF (java)

172 views
Skip to first unread message

pnu...@gmail.com

unread,
Jun 30, 2017, 1:44:38 AM6/30/17
to openpyxl-users
Hi guys,

I made a python script to modify and save excel files.

The excel files are read by another Java script using POI-XSSF library ( library that reads xlsx file format )


With the python script, I modified some cells and save by using openpyxl.

It looks succesessful at my glance. When I opened the excel file, I found it the cell values are changed successfully.

However, some problems emeged.

When I tried to close the excel file, the pop-up appeared reading "Do you want to save ? Yes / No". 

If I choose "Yes", then the Java script works well.

But, if I chooese "No", the Java script read nothing at all from the excel file as if it was a blank file.


My aim is to automate the modification of excel files in Linux system, without opening excel file manually.

But in this circumstances, the automation falls into failure ....

Is there any solution in this problem ? or is it the limitation of openpyxl library?

I would be very grateful for you to help me.

Thank you for reading.


v.k.s...@gmail.com

unread,
Jul 18, 2017, 10:05:02 AM7/18/17
to openpyxl-users, pnu...@gmail.com
I'm wondering if this has something in common with this issue https://github.com/ClosedXML/ClosedXML/issues/279

It is for totally different library and the problem is present on iPad and iPhone, but it can be caused by the same thing.

If you manually change the 'xl/_rels/workbook.xml.rels' to contains relative paths instead of absolute the same way as the files in this comment https://github.com/ClosedXML/ClosedXML/issues/279#issuecomment-296237624 did the java library opens it correctly?

Charlie Clark

unread,
Jul 18, 2017, 10:11:21 AM7/18/17
to openpyxl-users, v.k.s...@gmail.com, pnu...@gmail.com
Am .07.2017, 16:05 Uhr, schrieb <v.k.s...@gmail.com>:

> If you manually change the 'xl/_rels/workbook.xml.rels' to contains
> relative paths instead of absolute

Absolute paths are allowed by the specification and make a lot more sense
for any library.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226

v.k.s...@gmail.com

unread,
Jul 18, 2017, 10:35:30 AM7/18/17
to openpyxl-users, v.k.s...@gmail.com, pnu...@gmail.com
I also think that with absolute paths is better and actually file with them can be opened almost everywhere this means that the problem is in the software that does not support them.

I just wanted to ask pnu...@gmail.com to try and see if this will solve his problem. If this is the problem then he can try to create issue for the java library that he uses that they do not support absolute paths.

If this does not help then the problem is somewhere else and we need to see if it is in the java library that he uses or in openpyxl.

Regards,
Venelin Stoykov
Reply all
Reply to author
Forward
0 new messages