CreateObjectΒΆ
CreateObject creates a new COM-Object.
-
o = CreateObject(ssServer)
Return Value
o is a reference to an COM server.
Parameters
-
ssServer
ssServer is a string of the form
servername.typename
, e.g."Excel.Application"
.
Example
In the following example a matrix with 10 rows and 5 columns is written into a Excel worksheet:
def WriteMatrixToExcel()
{
rmData = zeros(10,5);
rmData[1;1] = 2;
rmData[10;1] = 10;
rmData[2;3] = 5;
rmData[10;5] = 100;
ox = CreateObject("Excel.Application");
ox.Workbooks.Add();
ox.ActiveWorkbook.Worksheets(1).Activate();
as = ox.ActiveSheet;
c = as.Range("A1:E10");
c.Value = rmData;
ox.visible = 1;
ox = 0;
}
See also
id-433573