Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you read a password protected excel file into r?

Tags:

r

excel

How do you read a password protected excel file into r?

I have tried excel.link but its not available for R version 3.2.3 (My version)

I also tried RDCOMClient but it is also not available for R version 3.2.3

like image 820
telfreth Avatar asked Mar 07 '16 19:03

telfreth


1 Answers

I just used xl.read.file from the excel.link package.

https://rdrr.io/cran/excel.link/man/xl.read.file.html

It was very straightforward.

Using the same test file from the previous answer (https://github.com/miraisolutions/xlconnect/files/794219/TestWorkbook.xlsx).

install.packages("excel.link")  library("excel.link")  dat <- xl.read.file("TestWorkbook.xlsx", password = "pass", write.res.password="pass")  dat 

(The file I needed only had one password, unlike the test file, so I didn't need the last argument for my use.)

like image 159
Chris Andrews Avatar answered Sep 24 '22 22:09

Chris Andrews