View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default excel crashing after deleting shapes

Can't see an obvious reason why that code should cause Excel to crash
subsequently on saving. You could try simply -

ActiveSheet.DrawingObjects.Delete

I can only assume there is something else wrong with your file, other code,
or something particular about the shapes you are deleting. Any code in the
Workbook_BeforeSave event getting confused?

Regards,
Peter T


"slarbie" wrote in message
...
Recently I've had two different files crash my excel consistently under

these
conditions.
Used some code to copy sheets to a new workbook, then this segment:

Dim shp as Shape
For Each Shp In ActiveSheet.Shapes
Shp.Delete
Next Shp

After the sub ends and I try to save the new workbook, Excel is crashing
every time. One of the sheets I'm using this for has enough shapes on it
that I don't want to make a line naming each one to delete. How else can

I
skin this cat?