Romulus
Romulus

Reputation: 1260

How to copy correctly ".xlsx" file with Python

I am working with Excel and Python. I want to copy and modify an Excel file with ".xlsx" extension, using a script written in Python. The file contains a specific format and some cells have a specific styles. When I am working with ".xls" extension file, I am using "formatting_info" for copying the Excel file in a workbook like this:

readBook = open_workbook(fileName, formatting_info=True)

and then modified it and then save it.

The problem is that I can't use "formatting_info" with ".xlsx" file;

I got an error:

formatting_info=True not yet implemented

I was looking for a solution; but I didn't find anything which helped me.

The question is: is there a way to copy and modify that ".xlsx" file and keep the style and the font?

I attach an example:

enter image description here

Upvotes: 1

Views: 2737

Answers (1)

kamzur
kamzur

Reputation: 17

The same is the case, there is at the following link:

python xlutils : formatting_info=True not yet implemented

formatting_info=True 

only works on .xls not .xlsx file.

Upvotes: 2

Related Questions