When importing all Excel files in a folder, it fails to import due to Excel temporary file

Problem

When you try to import Excel files in a folder, you might see an error like the one below.

R error: Error in map(.x, .f, ...) : ℹ In index: 15.
ℹ With name: D:\\Tests\\~$SomeTest2022_4.xlsx.
Caused by error in `value[[3L]]()`:\n! EXP-DATASRC-13 :: [\"D:\\Tests/~$SomeTest2022_4.xlsx\",\"zip file 'C:\\\\exploratory\\\\tmp\\\\RtmpojrcNR\\\\file10807ea91162.xlsx' cannot be opened\"] :: Failed to import file."

Solution

Delete the temporary files from the folder and try again. If you still see the error, create a new folder, move the Excel files to the newly created folder then try to import all from the new folder.