Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using excel 2000
i use the following code to delete all the shape in a document newBook.Worksheets(nameofsheet).Select newBook.Worksheets(nameofsheet).Shapes.SelectAll Selection.ShapeRange.Delete It works fine with most document but in two cases, there is an out of memory error at shapes.selectALL but i think there is plenty of memory could anyone tell me what is the cause and how to fix this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Laguna,
What does .Shapes.Count equal ? NickHK "Laguna" wrote in message ... I am using excel 2000 i use the following code to delete all the shape in a document newBook.Worksheets(nameofsheet).Select newBook.Worksheets(nameofsheet).Shapes.SelectAll Selection.ShapeRange.Delete It works fine with most document but in two cases, there is an out of memory error at shapes.selectALL but i think there is plenty of memory could anyone tell me what is the cause and how to fix this? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Running your code with Comments on the sheet might cause that problem, and
some other types of shapes. Try - newBook.Worksheets(nameofsheet).DrawingObjects.del ete above shouldn't error even if the DrawingObjects count is zero Regards, Peter T "Laguna" wrote in message ... I am using excel 2000 i use the following code to delete all the shape in a document newBook.Worksheets(nameofsheet).Select newBook.Worksheets(nameofsheet).Shapes.SelectAll Selection.ShapeRange.Delete It works fine with most document but in two cases, there is an out of memory error at shapes.selectALL but i think there is plenty of memory could anyone tell me what is the cause and how to fix this? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One more...
dim ictr as long for ictr = newBook.Worksheets(nameofsheet).Shapes.count to 1 step -1 newBook.Worksheets(nameofsheet).Shapes.delete next ictr Laguna wrote: I am using excel 2000 i use the following code to delete all the shape in a document newBook.Worksheets(nameofsheet).Select newBook.Worksheets(nameofsheet).Shapes.SelectAll Selection.ShapeRange.Delete It works fine with most document but in two cases, there is an out of memory error at shapes.selectALL but i think there is plenty of memory could anyone tell me what is the cause and how to fix this? -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for the help
i have used the code suggested by peter to solve the problem and for Dave Peterson I have used your apporach at beginning before i use the selectAll merhod but this will lead to another error in some cases. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Run-Time Error: You must select a shape | Excel Worksheet Functions | |||
Select Multiple Shape Objects | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |