2

I have been using the XLConnect package to read in password protected worksheets in R. Recently, the following error appeared when attempting to read in the file. Is anyone familiar with this error?

Error: NoSuchMethodError (Java): org.apache.xmlbeans.XmlCursor.close()V

Session Information:

R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] XLConnect_1.0.6

loaded via a namespace (and not attached):
 [1] compiler_4.2.2  fastmap_1.1.0   cli_3.4.1       htmltools_0.5.3 tools_4.2.2     rstudioapi_0.14 yaml_2.3.6      rmarkdown_2.17 
 [9] knitr_1.40      xfun_0.34       digest_0.6.30   rJava_1.0-6     rlang_1.0.6     evaluate_0.17   fortunes_1.5-4 

I have updated XLConnect.

bswan23
  • 41
  • 5
  • I have the exact same problem with the same version of R *(4.2.2 (2022-10-31 ucrt))*, Windows 10 x64 (build 19044) and XLConnect_1.0.6. The only difference is that I have the locale as English_United Kingdom, and also another package attached dplyr_1.0.10. 4 days ago the script was working without problems. Also tried on another laptop, same problem. – AnnePauline Nov 18 '22 at 10:23

2 Answers2

2

Looks like the issue was resolved by the package developers. I tried out the solutions below, and it worked for me.

Full thread: https://github.com/miraisolutions/xlconnect/issues/181

Specific fix: https://github.com/miraisolutions/xlconnect/issues/181#issuecomment-1299911543

bswan23
  • 41
  • 5
0

I have exactly the same problem with the same R & XLConnect versions, and didn't find any workout yet. Most probably have to switch to openxlsx since I need to get things done.

ecco
  • 51
  • 1
  • 5
  • I was able to read in password protected workbooks using the "excel.link" package as well. https://stackoverflow.com/questions/35852722/how-do-you-read-a-password-protected-excel-file-into-r – bswan23 Nov 17 '22 at 22:32