.COM | R Documentation |
This is the S function that provides full access to the C routines that perform the invocation of methods in COM servers. This allows one to control the specification of the dispatch method, whether the result is returned.
.COM(obj, name, ..., .dispatch = 3L, .return = TRUE, .ids = numeric(0), .suppliedArgs)
obj |
the COM object reference, usually obtained via
|
name |
the name of the method or property to be accessed. |
... |
arguments to be passed to the method. If names are provided for these arguments, these are used as the names in the COM call. (Not yet!) |
.dispatch |
one or more of the |
.return |
a logical value indicating whether to bother returning the result of the call. This can be used to discard the result of the invocation when only the side-effect is of interest. |
.ids |
an optional numeric vector which, if given,
provides the |
.suppliedArgs |
a logical vector indicating which of the
arguments provided by ... are to be used. In general, this argument
is not used in interactive use. However, when the code calling the |
An arbitrary value obtained from converting the value returned from the COM invocation.
We have madee PROPERTYGET|METHOD the default for method invocation. In this case, this function would become less commonly used.
Also, we will add code to handle the DispatchMethods enumeration symbollically in the same we have for Gtk enumerations in RGtk.
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
COMCreate
COMAccessors
getNameIDs
e <- COMCreate("Excel.Application") books <- e[["Workbooks"]] books$Add() # Now for the example! books$Item(1) sheets <- e[["Sheets"]] sheets$Item(1) ## Not run: # We can index the list of sheets by sheet name. # This is not run here as the name is different for # different languages. sheets$Item("Sheet1") ## End(Not run) # Now tidy up. e$Quit() rm(list = c("books", "e", "sheets")) gc() ## Not run: o = COMCreate("Excel.Application") .COM(o, "Count", .dispatch = 2, .ids = id) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.