Error: Zipping Up Workbook Failed When Trying to Write.Xlsx

Write file xlsx in R without using Java

Can you use the WriteXLS package?

WriteXLS(x, ExcelFileName = paste0(tempfile, ".xlsx"), SheetNames = NULL, row.names = FALSE, col.names = TRUE)

Edit:
If you're trying to save data to different sheets, turn your data into a list:

mySheets = c("data1", "data2")

BadZipFile: File is not a zip file - Error popped up all of a sudden

It is a very common issue and many people are trying to solve.It is related to excel file and openpyxl. Like @Barmar said in his comments xlsx, xlsm, etc are indeed zip. It was working fine until python 2.7 .

Try reading and writing to a csv instead, it won't be a problem.



Related Topics



Leave a reply



Submit