Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Select shape leading to Out of memory

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Select shape leading to Out of memory

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Select shape leading to Out of memory

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Select shape leading to Out of memory

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Select shape leading to Out of memory

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Run-Time Error: You must select a shape Lee Excel Worksheet Functions 1 January 25th 05 05:31 PM
Select Multiple Shape Objects Alan Excel Programming 0 November 24th 04 06:25 AM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


All times are GMT +1. The time now is 01:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"