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