omegahat / RDCOMClient

GNU General Public License v2.0
77 stars 34 forks source link

Unavilable for R 4.3? #49

Closed rdinter-usda closed 4 months ago

rdinter-usda commented 7 months ago

Attempting to install on a 4.3 version of R returns these errors:

install.packages("RDCOMClient", repos = "http://www.omegahat.net/R", type = "win.binary")

Installing package into ‘C:/Users/Robert.Paulson/AppData/Local/R/win-library/4.3’ (as ‘lib’ is unspecified) Warning in install.packages : unable to access index for repository http://www.omegahat.net/R/bin/windows/contrib/4.3: cannot open URL 'http://www.omegahat.net/R/bin/windows/contrib/4.3/PACKAGES'

package ‘RDCOMClient’ is available as a source package but not as a binary

Warning in install.packages : package ‘RDCOMClient’ is not available as a binary package for this version of R

A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

I can see that https://www.omegahat.net/R/bin/windows/contrib/4.2/PACKAGES exists but not the 4.3 equivalent. Is there plans to support R 4.3? Or a way to install onto 4.3 based on the 4.2 version of RDCOMClient?

MrNoClue commented 5 months ago

I have same issue trying to install after updating to R 4.3.2 :(

jimitnaik commented 5 months ago

@rdinter-usda @MrNoClue Facing the same issue with R version 4.3.1. Is there any solution you came across until now?

MrNoClue commented 5 months ago

A 'solution' that worked, was that I got the folder with the "RDCOMClient" from another person, that had it installed on what I presume earlier version of R. With this I just put it in the library where packges are in my file explorer - launched R and loaded the package.

MrNoClue commented 5 months ago

RDCOMClient.zip This one worked for me, try at own risk.

adelivuk commented 5 months ago

Ok, here's the deal - I tried on my local PC env (win 11) to do the same thing. I am using:

- R v4.3.1
- RStudio v2023.12.1 Build 402

both the latest versions of themself.

There is a other way and that is to install it from git. To make it work You need to install additional packages and tool(s) - here are the commands (in RStudio):

library("devtools")
install_github("omegachat/RDCOMClient")

Which will prompt RStudio to Windows to install RTools that are needed. After that I created a simple test.xlsx file with the password "test1234" and some dummy content:

a1 a2 a3
b1 b2 b3
c1 c2 c3

After that I added the code from the SO:

library(RDCOMClient)
xlApp <- COMCreate("Excel.Application")
xlWbk1 <- xlApp$Workbooks()$Open("C:/Users/Antonio/Desktop/text.xlsx", Password = "test1234") # note that for the path is / in Windows
xlWbk1$sheets(1)$cells(1,1)$value()

Which prints

"1a"

Hope it helps.

duncantl commented 5 months ago

Terrific. Thank @adelivuk. It is a non-trivial effort for me to spin-up an up-to-date Window's environment, but as adelivuk shows, it is really quite simple to build this package from the source version. Should building from source in this way fail, I am happy to dig into the code and fix it, but it has installed from source for many, many years in this simple way as far as I am aware. Thanks again @adelivuk

rdinter-usda commented 4 months ago

I can now confirm that devtools::install_github("omegahat/RDCOMClient") will install the package. I had other issues with rtools that stopped this from working for me but now that's cleared away.