ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/Excel/CreateNewExcelWorksheet
The command creates a new Excel worksheet in a specified path. If the specified Excel worksheet already exists, no new Excel worksheet will be created.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bExcelCreateNewExcelWorksheet : BOOL;
OutputDataExcelCreateNewExcelWorksheet : ST_VoidOutputData;
hrExcelCreateNewExcelWorksheet : HRESULT;
fbExcel : FB_Excel;
END_VAR
hrExcelCreateNewExcelWorksheet := fbExcel.CreateNewExcelWorksheet(
bExecute := bExcelCreateNewExcelWorksheet,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sFileFullPath := 'C:\Test\TestFile.xlsx',
sWorksheetName := 'Testsheet',
OutputData => OutputDataExcelCreateNewExcelWorksheet);
IF hrExcelCreateNewExcelWorksheet <> S_FALSE THEN
bExcelCreateNewExcelWorksheet := 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".