.. highlightlang:: us .. index:: ExcelWriteEx .. _excelwriteex: ExcelWriteEx ============ .. us.tag ExcelWriteEx ENGLISH New5508 Changed6200 The :ref:`ExcelWriteEx` function saves data in an Excel file in the XLSX format. .. function:: bool = ExcelWriteEx(ssFileName, smMatrix, smType) bool = ExcelWriteEx(ssFileName, smMatrix) bool = ExcelWriteEx(ssFileName, rmMatrix) .. us.return **Return Value** If the function succeeds, the return value is TRUE (1); otherwise it is FALSE (0). .. us.params **Parameters** .. uparam:: ssFileName *ssFileName* is the file name. Normal extension is .xlsx. .. uparam:: smType *smType* is a string matrix that defines the type of the corresponding elements in the parameter *smMatrix*. .. list-table:: :header-rows: 1 * - Value - Meaning * - ``"I"`` - The corresponding element in smMatrix will be converted into a 16 bit unsigned integer number. * - ``""`` - Empty string. The corresponding element in smMatrix will be converted into a real number. * - ``"S"`` - The corresponding element in smMatrix will be written as a string. As of version R2020.0, the string ``"auto"`` can be given as a third parameter. If ``"auto"`` is set, the type matrix will be automatically generated depending of the values given in the parameter *smMatrix*. If a cell contains a valid number, for example "13.27", it will be added as a number. "13.27 kg" will be added as a text. See example below. .. uparam:: smMatrix *smMatrix* is a string matrix. .. uparam:: rmMatrix *rmMatrix* is a real matrix. .. us.comment **Comment** The maximum number of rows is limited to approx. 1 million rows and 65000 columns. .. us.example **Example** :: smData = ["Speed", "Torque"; "rpm", "Nm"; "1000.0", "10.5"; "2000.0", "20.0"]; smType = ["S", "S"; "S","S"; "", ""; "",""]; ExcelWriteEx("d:/a.xlsx", smData, smType) :: smData = ["Speed", "Torque"; "rpm", "Nm"; "1000.0", "10.5"; "2000.0", "20.0"]; ExcelWriteEx("d:/b.xlsx", smData, "auto") .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2020 - Parameter ``"auto"`` .. seealso:: :ref:`overview-excel-files`, :ref:`ExcelRead`, :ref:`ExcelWrite` :sub:`id-1744635`