COMAccessors | R Documentation |
These operators provide a more S-like
syntax for accessing methods and properties
in a dynamic COM object.
One calls a COM object method using the $
operator.
The values of COM object properties are retrieved and set
using [[
and [[<-
, respectively.
Setting a property returns NULL
.
Invoking a method and getting a property value returns an S object representing the COM value. Primitive COM values are converted to the corresponding S objects. COM objects are returned as COMIDispatch objects.
the COMIDispatch object whose method or property is to be invoked.
Duncan Temple Lang (duncan@r-project.org)
http://www.omegahat.net/RDCOMClient http://www.omegahat.net/RDCOMServer http://www.omegahat.net/SWinTypeLibs http://www.omegahat.net/SWinRegistry
.COM
COMCreate
COMList-class
COMTypedList-class
COMTypedNamedList-class
e <- COMCreate("Excel.Application") # Boolean/Logical e[["Visible"]] # Setting a value. e[["Visible"]] <- TRUE # String e[["Path"]] e[["Version"]] # Double e[["Width"]] # Long e[["SheetsInNewWorkbook"]] # Object books <- e[["Workbooks"]] books$Add() # Use this as a container, so can have integer indices, 1-based. books[[1]] e[["Workbooks"]][[1]] ## Not run: books$Open("C:\mySheet.xls") ## End(Not run) e$CheckSpelling("This is a spell check") # okay e$CheckSpelling("This is a spell chck") # error ## Not run: e$SaveWorkspace() ## End(Not run) e$Quit() rm(list= c("e", "books")) gc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.