Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
talendtester
Creator III
Creator III

How can I delete a Worksheet from an Excel workbook?

What component do I use to delete a worksheet from an Excel workbook?
Labels (2)
4 Replies
Anonymous
Not applicable

Hi talendtester,
I couldn't identify a component to delete a worksheet..
But there is a work around -- read excel file and all the worksheets except the one which you want to delete and connect to outputexcel new file. Once done, delete old excel file.
Check the blog post - http://www.vikramtakkar.com/2012/12/reading-excel-files-using-talend-open.html...
Vaibhav
Anonymous
Not applicable

There is an easy way:
tFileExcelWorkbookOpen --OnSubjobOk--> tFileExcelWorkbookSave
In tFileExcelWorkbookOpen specify your source file.
In the component tFileExcelWorkbookSave you can specify the sheets to delete and you can specify an output file name different or simply the same from the source file.
talendtester
Creator III
Creator III
Author

Thanks jlolling,
I get this error on the tFileExcelWorkbookSave at the very last step of the job:
Exception in component tFileExcelWorkbookSave_1
java.lang.IllegalArgumentException: workbook cannot be null!

Here is my job:
tFileExcelWorkbookOpen > tFileExcelSheetList > tMap (if statements to make the ones I don't want to load null) > tFilterRow > tFileOutputDelimited > okComponentOk > tFileInputFullRow > tMap > tContextLoad > tFlowToIterate > tFileExcelWorkbookSave
talendtester
Creator III
Creator III
Author

jlolling,
Do I need to make 30 context variables, load them all, and the call them in the tFileExcelWorkbookSave component so all the worksheets can be deleted in a single pass?