I have been trying the whole day to import a dataset from excel to R, which is password-protected. I have tried so many things, but always end up getting some kind of error-message. I really need help, thanks a lot!!
this was my latest attempt (I put in the real password of course):
I don't see any way to read a password protected Excel file with either readxl or openxlsx. The excel.link package has the function xl.read.file() that can do it. The package requires that Excel be available. I have never used the excel.link package.
Would it not be possible to open the excel file in excel and export the contents to a non-password protected excel file or just a simple csv file? and then import the new file.
If the issue is that you cannot access Excel or the Native Windows COM interface to create an excel instance in the shell (i.e. on linux server) then you could resolve the issue via some Python and (if necessary) wrap the python with reticulate.
The best python library for this is msoffcrypto-tool which does not require Excel installation and is fully cross-platform with Python. It also supports all password-protected (encrypted) Microsoft Office documents, including the older XLS binary file format.