I have run Excel and selected a range of values.
Then I run this code in RStudio:
library(DescTools)
BMI <- XLGetRange(header=TRUE)
I get this error message:
Loading required namespace: RDCOMClient
Error in sel$Cells() : attempt to apply non-function
I checked the source code of XLGetRange()
......
if(is.null(file)){
xl <- GetCurrXL()
ws <- xl$ActiveSheet()
if(is.null(range)) {
# if there is a selection in XL then use it, if only one cell selected use currentregion
sel <- xl$Selection()
if(sel$Cells()$Count() == 1 ){
range <- xl$ActiveCell()$CurrentRegion()$Address(FALSE, FALSE)
}
.....
xl <- GetCurrXL() returns
An object of class "COMIDispatch"
Slot "ref":
<pointer: 0x000000000011b688>
Hi Herman
I hope you've reported this to the author of DescTools. That is the first place to start to see if
it is a problem with the logic in that package's function.
I am running R version 3.5.0
I have installed the packages:
I have run Excel and selected a range of values. Then I run this code in RStudio:
I get this error message:
I checked the source code of XLGetRange()
xl <- GetCurrXL() returns
xl$ActiveSheet() returns NULL xl$Selection() returns NULL
Your help will be greatly appreciated. Herman