Hi -
1) Yes. This takes a moment to explain, but it's doable.
In this code snippet, we have a ChartArchiveBook that simply holds a
large number of charts in WMF/EMF format. It assumes that you have
already selected the chart.
With ActiveChart
.ChartArea.Select
.CopyPicture Appearance:=xlPrinter, Size:=xlScreen,
Format:=xlPicture
End With
'
' First name the graph so we can find it again, and put it where we
can see it...
'
GraphName = "WhateverYouWantItToBe"
' The following pastes to the proper format and to the proper place.
You can fiddle with the range...
'
With Workbooks(IndustryAnalyseBook).Sheets(AnalyseBookS heetName)
.Activate
.Range("A1").Select
.PasteSpecial Format:="Bild (Extended Metafile)",
Link:=False, _ DisplayAsIcon:=False
End With
With Selection.ShapeRange
.Parent.Name = GraphName
.Height = 500
.Width = 232
End With
The latter code simply places it in cell A1 and gives it the size of
500 by 232 pixels, you'll want to change that.
2) This took a long time to figure out, but it works great:
For Each MyShape In
Workbooks("TargetWorkbook").Sheets("TargetWorkshee t").Shapes
If MyShape.Name = GraphName Then MyShape.Delete
Next MyShape
These code snippets are part of a very large system, so they might not
be completely understandable: let me know if you need further
explanation...
John
PS: some of the code wraps funny here...you'll need to play with it to
get it working right...
|