3

I use R XLConnect package. When I wrote 'XLConnect' function, such as loadWorkbook(), readWorksheetFromFile() etc. , this error message happen.

Error: IllegalArgumentException (Java): Your InputStream was neither an OLE2 stream, nor an OOXML stream

How to solve this problem?

Before using this function, I took action against crashing between R and Mac OS X by the way http://www.r-bloggers.com/getting-r-and-java-1-8-to-work-together-on-osx/ link told.

I have used Mac OS X.

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
Luis Kang
  • 251
  • 1
  • 4
  • 15

3 Answers3

0

This message states that the file you have provided to loadWorkbook has not been recognized as *.xls (BIFF-8) or *.xlsx (OOXML) file.

Martin Studer
  • 2,213
  • 1
  • 18
  • 23
0

I am having the same issue following a Java update. I was asking to load a .xlsx file to the function loadWorkbook() of the R XLConnect package. I temporary solved the issue by asking to load an .xls file.

KK_63
  • 105
  • 4
0

I also use OS X and after working without problem for a while with this function this error raises without apparent reason... But the reason is really simple. Excel (actually, all MS Office suite) creates temporary files meanwhile you have open the file. This file is hidden:

enter image description here

In my case, I list .xlsx files to open them inside a loop. So, the first file was a hidden file and the error raised. Closing excel (to delete those file) is the solution to avoid this error.

aldo_tapia
  • 1,153
  • 16
  • 27