.. highlightlang:: us .. index:: CreateObject .. _createobject: CreateObject ============ .. us.tag CreateObject NOTREADYENGLISH Programming.ActiveX New300 :ref:`CreateObject` creates a new COM-Object. .. function:: o = CreateObject(ssServer) .. us.return **Return Value** *o* is a reference to an COM server. .. us.params **Parameters** .. uparam:: ssServer *ssServer* is a string of the form ``servername.typename``, e.g. ``"Excel.Application"``. .. us.example **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; } .. seealso:: :ref:`overview-programming`, :ref:`GetObject`, :ref:`CreateObjectEmbedded` :sub:`id-433573`