I want to delete a worksheet if it does not contain any data / diagrams / images / drawing objects / hyperlinks or any other embedded objects.
I found a solution to detect and remove blank sheets if there is no data in the cells using the following code: -
if ($ Worksheet_Function-> CountA ($ sheet → {Cells}) == 0) {$ Sheet-> Delete; }
but also deletes the sheet if there are diagrams or non-text objects.
Is there a way to identify and delete sheets if it is completely empty?
source
share