This user had the same error I had and I solved it. Someone kind of solve it but was not the right way.
The issue was the following:
Hi, i found about a package who could export my data.frame to excel, but i encounter some difficulties.
(I'm new on this plateform and i'm sorry if something in my request is wrong, do not hesitate to get me noticed about it if it is the case!)
I am trying to export a dataframe called "div1" to an excel doc called "TEST.xlsx" using the function write_xlsx from the package writexl, but i got an error message and don't know how to resolve it:
There is my running of the console:
> write_xlsx(div1,"C:\\Users\\Utilisateur\\Desktop\\TEST.xlsx")
[ERROR] workbook_close(): Error creating 'C:\Users\Utilisateur\Desktop\TEST.xlsx'. System error = Permission denied
Erreur : Error in libxlsxwriter: 'Error creating output xlsx file. Usually a permissions error.'
I was having the same error but because I was chosing a new folder that was out of the working directoy that I previously set.
It looks like Callipygeophile did the same mistake.
His/her error was a Permission error. For solving this, he must previously update the new working directory and make sure that the path where we want to save our data "path/mydata.xlsx" is WITHIN the working directory or update the working directory with the necessary new path.
It might sound a bit simple and obvious to do, but just as him/her some of us were stopped because of that, because we forgot that we were using a different path from the working directory.
If anyone has a better explanation I am happy to be corrected.