Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Transform Formulas Excel into Values Excel

$
0
0

im trying to generate an Excel only with values from another Excel that I create before with the same script. The main problem is that im trying to do it reading the excel with the library openpyxl like this: workbook = load_workbook(path, data_only=True), but the formulas in the excel that im reading are not evaluated so it gives me blank cells.

I found a solution but just for Windows running excel before reading it like this :

instancia = win32.gencache.EnsureDispatch('Excel.Application')#hay que meter la misma ruta que la escrita en pathworkbook = instancia.Workbooks.Open(path)workbook.RefreshAll()workbook.Save()workbook.Close()instancia.Quit()workbook = load_workbook(path, data_only=True)workbook.save(new_excel_file_path)

I need to do the same for a linux enviroment and i dont find a way to do it.Thanks


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>