How to maintain the style and format in excel from python

0

Hello, good night, everyone. I'm working on a project with Excel and Python. In this case I have to make some modifications to an xlsx file. But this file comes with a certain format and style in each of its pages. The problem I'm having when saving the file is losing the original format, and everything is shown as if it were in plain text. Here I have a fraction of the code.

import openpyxl as xl
*#Abrir archivo* 
wb = xl.load_workbook("CR_Accounts_Dashboard_V4_20170127.xlsx") 

*#...
#...
# Aquí se trabaja el archivo 
#...
#...*

*#Salvar el archivo luego de las modificaciones.*
wb.save("CR_Accounts_Dashboard_V4_20170127.xls")

Then as I said, after saving the file I'm losing the format and style. Here some images to show the problem.

Original file After saving the file

Here is another example.

This is another sheet the original file. After saving the file So if someone has an idea of how to maintain the style of the file, I would greatly appreciate it. Thanks

    
asked by Carlos Arronte Bello 17.02.2017 в 05:01
source

1 answer

0

Maybe it will help you, it's something similar.

link

    
answered by 17.02.2017 в 07:29