View Full Version : Delete freeform from spreadsheet

09-21-2011, 08:46 AM
Hi everyone,
I have a perculiar problem with shapes.delete. The following code works fine for any freeform on the spreadsheet.

Dim wb as workbook, ws as worksheet
Dim Sh As Shape
Set wb = ThisWorkbook
Set ws = wb.sheets("Sheet1")
With ws.
For Each Sh In .Shapes
If Sh.Type = msoFreeform Then: Sh.Delete
Next Sh
End With

However, when the freeform is positioned over a chart object, it is not deleted. I really don't understand :dunno