Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I delete an embedded picture on a worksheet using VBA?

My VBA routine copies an embedded chart from a worksheet to another worksheet
as a picture (CopyPicture). This works fine but I want to clear the picture
from the destination worksheet before copying anouther picture to it, so the
pictures don't build up. I can't seem to find a way to activate the picture
via VBA so that it can be deleted.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How do I delete an embedded picture on a worksheet using VBA?

hi GTJames

See
http://www.rondebruin.nl/controlsobjectsworksheet.htm



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



"GTJames" wrote in message ...
My VBA routine copies an embedded chart from a worksheet to another worksheet
as a picture (CopyPicture). This works fine but I want to clear the picture
from the destination worksheet before copying anouther picture to it, so the
pictures don't build up. I can't seem to find a way to activate the picture
via VBA so that it can be deleted.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How do I delete an embedded picture on a worksheet using VBA?

Try something like the following:

Dim ChtObj As ChartObject
Dim Pict As Picture
Set ChtObj = Worksheets(1).ChartObjects(1)
ChtObj.CopyPicture xlScreen
On Error Resume Next
Worksheets("sheet2").Pictures(1).Delete
On Error GoTo 0
Worksheets("Sheet2").Paste


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com






"GTJames" wrote in message
...
My VBA routine copies an embedded chart from a worksheet to
another worksheet
as a picture (CopyPicture). This works fine but I want to
clear the picture
from the destination worksheet before copying anouther picture
to it, so the
pictures don't build up. I can't seem to find a way to activate
the picture
via VBA so that it can be deleted.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default How do I delete an embedded picture on a worksheet using VBA?

does this help?

Sub findPicturename()
msn = "Picture " & ActiveSheet.Shapes.Count
MsgBox msn
ActiveSheet.Shapes(msn).Cut 'Select
End Sub

--
Don Guillett
SalesAid Software

"GTJames" wrote in message
...
My VBA routine copies an embedded chart from a worksheet to another
worksheet
as a picture (CopyPicture). This works fine but I want to clear the
picture
from the destination worksheet before copying anouther picture to it, so
the
pictures don't build up. I can't seem to find a way to activate the
picture
via VBA so that it can be deleted.



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
Delete embedded chart, how? Boswell Charts and Charting in Excel 1 December 16th 07 07:08 PM
Picture embedded in data row helen Excel Discussion (Misc queries) 1 January 21st 07 08:18 AM
embedded picture in excel KalpeshPatel Excel Discussion (Misc queries) 0 October 23rd 06 11:25 PM
data turned into embedded picture Robert New Users to Excel 0 January 21st 06 08:05 PM
How to extract a picture from an Excel worksheet into a picture fi SARANJAI Excel Discussion (Misc queries) 10 June 12th 05 05:00 AM


All times are GMT +1. The time now is 10:02 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"