Problem with Excel files saved with openpyxl

1,459 views
Skip to first unread message

janain...@gmail.com

unread,
Mar 20, 2017, 1:38:25 PM3/20/17
to openpyxl-users
I am using openpyxl to update a xlsx file and use it on my CPLEX-OPL, but everytime I save the file with the openpyxl, CPLEX does not recognize the xlsx file, unless I open the excel file and save it manually. Does anyone know if openpyxl change any configuration of my xlsx file (name or format) that could explain this and how can I fix it?

Charlie Clark

unread,
Mar 20, 2017, 2:12:01 PM3/20/17
to openpyx...@googlegroups.com
Does the application give you an error message as to why it cannot read
the file? openpyxl produces valid OOXML files so I suspect the problem is
with the application you're using and suggest you report a bug there.

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

janain...@gmail.com

unread,
Mar 20, 2017, 2:26:09 PM3/20/17
to openpyxl-users
*** ERROR[ENGINE_001] at 37:71-72 Sococo2017.dat: Exceçãoo do IBM ILOG Concert: Problem accessing the Excel file.

I found this post https://bitbucket.org/openpyxl/openpyxl/issues/547 and I believe my problem is very similar, openpyxl does not change any xlsx documentation at all?

Charlie Clark

unread,
Mar 20, 2017, 2:41:59 PM3/20/17
to openpyx...@googlegroups.com
Am .03.2017, 19:26 Uhr, schrieb <janain...@gmail.com>:

*** ERROR[ENGINE_001] at 37:71-72 Sococo2017.dat: Exceçãoo do IBM ILOG
Concert: Problem accessing the Excel file.

That's not much of an error message.

> I found this post https://bitbucket.org/openpyxl/openpyxl/issues/547 and
> I believe my problem is very similar, openpyxl does not change any xlsx
> documentation at all?

You can validate the file with the OOXML SDK Productivity Tool (link in
the documentation) and you'll see it's "valid". Maybe IBM can give you
further information as to why the application can't read the file but you
cannot assume the problem is with openpyxl.

janain...@gmail.com

unread,
Mar 20, 2017, 3:27:26 PM3/20/17
to openpyxl-users
I tried to upload the excel file saved with openpyxl on the Open XML SDK Productivity Tool and the follow message appears:

Cannot open the file: The process cannot access the file "C:\Users\Prosperity\opl\Sococo2017\Sococo_Dados_Resultado.xlsx" because it is being used by another process.

It seems like the file it is still runing. When I use wb.save() the file is closed automatically or do I have to use .close() or something like that?
I know that my CPLEX does not work with open files and maybe this is the problem.

Charlie Clark

unread,
Mar 21, 2017, 10:46:38 AM3/21/17
to openpyx...@googlegroups.com
Am .03.2017, 20:27 Uhr, schrieb <janain...@gmail.com>:

> It seems like the file it is still runing. When I use wb.save() the file
> is
> closed automatically or do I have to use .close() or something like that?
> I know that my CPLEX does not work with open files and maybe this is the
> problem.

openpyxl should garbage collect any file handles but if you're in doubt,
just close the Python process and anything else that might have the file
open.

Murali Mohan Garapati

unread,
Jan 11, 2023, 6:28:05 AM1/11/23
to openpyxl-users
Hi,
Did you see any solution for this? I am facing the same issue, it will be great if you can help on this.

Thanks,
Murali.
Reply all
Reply to author
Forward
0 new messages