Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting pictures using VBA??

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 n
idea. When I tried ActiveSheet.Pictures.Delete it deletes my cmdButton
too.

Any ideas??

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Deleting pictures using VBA??

small typo, should be

Dim myPic As Picture
Dim sPic As String

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


--

HTH

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

"Bob Phillips" wrote in message
...
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/





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Deleting pictures using VBA??

For a continuation of this discussion, see the concurrent subject
'Sorry here it is again' in the same newsgroup.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , Richard1284
says...
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/


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
Deleting pictures from multiple worksheets dford Excel Discussion (Misc queries) 2 December 24th 06 04:43 AM
Deleting Pictures to reduce workbook size Stephen POWELL Excel Discussion (Misc queries) 4 November 13th 06 11:38 PM
Excel's Compress Pictures or deleting pictures doesn't seem work guidod Excel Discussion (Misc queries) 1 January 29th 06 06:51 AM
deleting 100's of pictures, keep data jsc3489 Excel Worksheet Functions 9 June 16th 05 10:43 PM
deleting 100's of pictures, keep data jsc3489 Excel Worksheet Functions 0 June 8th 05 07:54 PM


All times are GMT +1. The time now is 05:34 PM.

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"