gdemin / excel.link

Convenient Data Exchange between R and Microsoft Excel
56 stars 16 forks source link

Excel.link under windows 10 and office 2016 #22

Closed TheChemENG closed 4 years ago

TheChemENG commented 4 years ago

Dear all,

The Excel.Link package rises an error under Windows 10 with Office 2016. The following RCode works correctly under Windows8 and office 2013

library(excel.link) xl[a1]

However, the same code under Windows 10 (x64) with Office 2016 (x32) leads to the following result:

library(excel.link) xl[a1] Error in xls[["Visible"]] : this S4 class is not subsettable

Do you have an idea regarding this error ?

Thanks in advance, TheChemENG

gdemin commented 4 years ago

Sorry, I can not reproduce this error. Could you run the following code:

library(excel.link)
xl.get.excel()

Which result it gives?

TheChemENG commented 4 years ago

Dear gdemin, thank you for your answer

The result of the command

library(excel.link) xl.get.excel()

Gives the same error : "Error in xls[["Visible"]] : this S4 class is not subsettable"

I finally manegd to understand why this error occurs. It comes from a "conflict" between the package RDCOMClient and excel.link When I detach the package RDCOMClient and execute the code :

library(excel.link) xl[a1]

excel.link works correctly. However the following code leads to a conflict

**Code** library(RDCOMClient) library(excel.link) xl[a1] Results*** Attachement du package : ‘RDCOMClient’

The following objects are masked from ‘package:excel.link’:

.COM, .COMInit, asCOMArray, COMCreate, COMList, COMNames,
COMStop, createCOMReference, createTypeVarName, EnumValue,
getCLSID, getCOMElements, getCOMInstance, isValidCOMObject

xl[a1] Error in xls[["Visible"]] : this S4 class is not subsettable


Consquently, if the package RDCOMClient is loaded, there is a risk of error when we load the package excel.link

Best regards,

gdemin commented 4 years ago

Generally, you don't need to load RDCOMClient because it is fully integrated into excel.link. It was CRAN requirement. And all RDCOMClient functions should be available after the loading just excel.link.