delete pictures with a macro

G

Guest

This is probably very basic but it has totally eluded a novice. In Excel
2003 I am copying a chart from workbook "wx" as a picture into workbook "yz"
using macro "a". I then later try to delete the picture with macro "b" in
order to save an updated version of the chart. Macro "b" seems to be unable
to find the picture to delete it.

The code I am using is the result of recording a macro. It works when I
record it but never after that. The code is:

macro "a"
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, Format:= _
xlPicture
ActiveWindow.Visible = False
Windows("wx.xls").Activate
Range("G29").Select
Windows("yz.xls").Activate
Range("A1").Select
ActiveSheet.Pictures.Paste.Select

macro "b"
Windows("yz.xls").Activate
ActiveSheet.Shapes("Picture 3").Select
Selection.Delete

Thanks very much for your help.

Noel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top