ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/Excel/WriteValuesToRow
The command writes new values to the cells of a row of the specified Excel worksheet in a specified path.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bExcelWriteValuesToRow : BOOL;
OutputDataWriteValuesToRow : ST_VoidOutputData;
hrExcelWriteValuesToRow : HRESULT;
WriteValuesArray : ARRAY[1..50] OF STRING(255) := ['val1','val2', 'val3'];
fbExcel : FB_Excel;
END_VAR
hrExcelWriteValuesToRow := fbExcel.WriteValuesToRow(
bExecute := bExcelWriteValuesToRow,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sFileFullPath := 'C:\Test\TestFile.xlsx',
sWorksheetName := 'Testsheet',
nRowNumber := 1,
nStartColumnNumber := 1,
sValueToWrite := WriteValuesArray,
nNumberOfValues := 3,
OutputData => OutputDataWriteValuesToRow);
IF hrExcelWriteValuesToRow <> S_FALSE THEN
bExcelWriteValuesToRow := FALSE;
END_IF
For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".