ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/Excel/ReadAllUsedCellsFromRow
The command reads out the values from the first filled cell to the last filled cell of a row in the specified Excel worksheet in a specified path. If there are empty entries between the first and the last filled cell, they are included in the output.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bExcelReadAllUsedCellsFromRow : BOOL;
OutputDataReadAllUsedCellsFromRow : ST_StringOutputData;
hrExcelReadAllUsedCellsFromRow : HRESULT;
fbExcel : FB_Excel;
END_VAR
hrExcelReadAllUsedCellsFromRow := fbExcel.ReadAllUsedCellsFromRow(
bExecute := bExcelReadAllUsedCellsFromRow,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sFileFullPath := 'C:\Test\TestFile.xlsx',
sWorksheetName := 'Testsheet',
nRowNumber := 1,
Separator := ',',
OutputData => OutputDataReadAllUsedCellsFromRow);
IF hrExcelReadAllUsedCellsFromRow <> S_FALSE THEN
bExcelReadAllUsedCellsFromRow := 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".