openxlsx::write.xlsx generates a broken file

Hello guys,

Im having troubles to generate xlsx, for some reason excel dont recognize my dataframe and ask me to repair the file, after that many of lines became incomplete.

write.xlsx(df1, file = "C:/Temp/test.xlsx")

Could you help me please?

Thanks!

Hi GLUIZON,
Welcome to RStudio Community!
Could you please provide reproducible example? See this post on what is this and how to do it - Reprex.

I had similar problems with XLSX files when I am writing Excel formulas in one of data frame columns and making mistake in formula in process. So my guess without seeing reprex is that data frame content is not something that could be saved inside XLSX cells.

Reprex will definitely help to provide you a better answer.

Regards,
Yan

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

Hello Yan_Iuesin,

Thank you very much for your reply, im trying to use the reprex function, but the following error occurred:

reprex::reprex()
Rendering reprex...
pandoc.exe: \: openBinaryFile: does not exist (No such file or directory)
Erro: pandoc document conversion failed with error 1

Maybe its because my code read a directory containing a lot of ".txt" files, so im still learning how to use reprex properly.

Best Regards,
GLUIZON