3

Typically I use the readxl package (which is quite good) for reading excel files:

 read_excel(path = 'ihateexcel.xls', sheet = 1)

However, the session will essentially freeze if I try and read an encrypted .xls file. Obviously don't want to save the file as .csv as I'll lose the encryption or have to use another encryption. Can't seem to find this functionality in other packages xlsx either.

How do I read an .xls file that is encrypted in excel?

Minnow
  • 1,733
  • 2
  • 26
  • 52
  • 2
    First step I would recommend would be to change the format of your data to some more open'ish one. Keep in mind you can have encrypted csv files. This question make help you later: [How do I read an encrypted file from disk with R](https://stackoverflow.com/questions/25318800/how-do-i-read-an-encrypted-file-from-disk-with-r). – jangorecki Dec 11 '15 at 23:45
  • These files are coming from another source (as encryped .xls). It would be preferable to just take them as is rather than decrypt, export as csv, then re-crypt with something else. – Minnow Jul 13 '16 at 18:28

1 Answers1

5

excel.link can help you in opening password protected files.

You can pass your 'password' in one of the arguments.

Usage

xl.read.file(filename, ...... password = NULL)
  • As an update: this doesn't seem to work with current (>4.0) R versions, see the issue https://github.com/gdemin/excel.link/issues/23 and https://github.com/gdemin/excel.link/issues/24 – user3283722 May 10 '21 at 10:36