View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to judge wheter an object is existing or not

The shape collection holds the list of all the shapes. It has a count
property, so to determine if there are no shapes

if activesheet.Shapes.count = 0 then
' there are no shapes.
else
for each shp in Activesheet.Shapes
msgbox shp.Name
Next
End if

--
Regards,
Tom Ogilvy


"lvcha.gouqizi" wrote in message
oups.com...
Thanks Tom very much!

I use shp = nothing in my original code so cannot get through each
time. My bad.

Can I ask more about Shape. What's the difference between Shape
Collection and Shape Object? If there is need to deal with shape
collection, should I use Null, Empty, or Nothing?