View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Please help Please help is offline
external usenet poster
 
Posts: 75
Default Removing Objects

I got it. What is the different between 11 (msoLinkedPicture) and 13
(msoPicture)?

Thanks both.

"Bob Phillips" wrote:

Look for msoShapeType in the object browser, all listed there.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ron de Bruin" wrote in message
...
Try this


Sub Shapes2()
'Loop through the Shapes collection and use the Type number of the control
Dim myshape As Shape
For Each myshape In ActiveSheet.Shapes

' Pictures
If myshape.Type = 13 Then myshape.Delete

Next myshape
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Please Help" wrote in message

...
Ron,

Your code and Bob's code work well, except I have a little problem. How

can
we modify it to exclude from deleting text boxes? I only want to delete
picture objects, neither forms or control objects.

Thanks.

"Ron de Bruin" wrote:

Hi Please Help

Look here
http://www.rondebruin.nl/controlsobjectsworksheet.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Please Help" <Please wrote in message

...
Hello,

I have a workbook that contains 5 worksheets. In each worksheet, I

have a
few picture objects. Is there a way that we can write a code to

remove all
the picture objects in the worksheets of the workbook?

Thanks.