View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Deleting pictures using VBA??

Hi Richard,

When you open the picture, set a variable to that pic, like so

Dim myPic As Picture
Dim sPic As String

sPic = ("F:\Dss\ass\Arran1.jpg"
Set myPic = ActiveSheet.Pictures.Insert(sPic)

and then you can simply delete it via the variable

myPic.Delete


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Richard1284 " wrote in message
...
Hi all,

Can anyone help me, I have inserted a picture
ie.
ActiveSheet.Pictures.Insert("F:\Dss\ass\Arran1.jpg ").Select

Now all I want to do is delete it using VBA. Unfortunately I have no
idea. When I tried ActiveSheet.Pictures.Delete it deletes my cmdButtons
too.

Any ideas???


---
Message posted from http://www.ExcelForum.com/