View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
slarbie slarbie is offline
external usenet poster
 
Posts: 53
Default excel crashing after deleting shapes

Thanks Bob - this was the more helpful reply. I really only have one shape
type in the sheet that needs deleting, so will go figure out that type's
proper excel name and add an if/then to test each one before deleting. I
think my code may have deleted essential pieces of a pivot table, and made it
'unsavable'.

Barb B.


"Bob Phillips" wrote:

Not sure, but it may be linked to deleting all shapes, including built-in
shapes. See a solution that Dave Peterson and I developed for a controlled
deletion of shapes at http://tinyurl.com/g2tsl

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"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?