COMCreate | R Documentation |
These functions are used from R to either create a COM object of a specific type or to obtain a reference to an existing COM application/object.
COMCreate(name, ..., existing = TRUE) getCOMInstance(guid, force = TRUE, silent = FALSE)
name |
the name identifying the type of COM object. This is usually the name of the class, such as Excel.Application. In the future, this may support finding class IDs separately and passing them as this argument |
... |
currently ignored. In the future, we will have arguments controlling how the server is created, e.g. the location of the machine, etc. |
guid |
a string (character vector of length 1) that identifies the GUID - Global Unique Identifier - for the COM interface of interest. This should have the curly braces ('...'). |
existing |
a logical value. If this is |
force |
a logical value. If this is |
silent |
a logical value that is used when |
This resolves the class ID given the name and
then creates the instance using CoCreateInstance
.
The class ID is found using CLSIDFromString
and if that fails using CLSIDFromProgID
.
An object of class COMIDispatch
.
getCOMInstance
works with Word and Excel
but for some reason on at least some machines fails
to find an existing Internet Explorer application.
As a result, it will create a new instance of the application.
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
The $
and [[
operators
for the COMIDispatch
class - COMAccessors
.
Also, see how one can generate "compiled" or processed interfaces
to any or all of the types in an application using the
SWinTypeLibs
.
## Not run: COMCreate("Excel.Application") getCOMInstance("{000208D5-0000-0000-C000-000000000046}") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.