View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default Export two overlapping charts to .gif

Bit complicated, but you could create an empty chart as a container
and then use CopyPicture to copy each chart and paste it into the
container chart. Then export the container chart.

Sub Macro1()

With ActiveSheet
.ChartObjects("Chart 2").Chart.CopyPicture _
Appearance:=xlPrinter, Size:=xlScreen, Format:=xlPicture

.ChartObjects("container").Chart.Paste

.ChartObjects("Chart 1").Chart.CopyPicture _
Appearance:=xlPrinter, Size:=xlScreen, Format:=xlPicture

.ChartObjects("container").Chart.Paste

'now position the pictures and size the container....

End With

'export the container chart

End Sub


Tim.


"DynamiteSkippy" wrote in
message ...
I have a worksheet with two overlapping charts and I am trying to
export them
to .gif picture format. I have tried several ways and have run out
of
creativity... Can anyone help??


Private Sub ChartExporter()
Dim SaveLoc As String
Dim Pict As Object
Dim chrt
Dim i As Integer

PowerWord1

Set Pict =
ThisWorkbook.Worksheets("Front").Shapes.Range(Arra y("Trend_Chart",
"Discrete_Chart")).Select
'ThisWorkbook.Worksheets("Front").ChartGroups()
''ERROR: out
of range???
'ActiveSheet.Shapes.Range(Array("Trend_Chart",
"Discrete_Chart")).Select ''ERROR: Object Required???

'ThisWorkbook.Worksheets("Front").Shapes.Range(Arr ay("Trend_Chart",
"Discrete_Chart")).Select ''ERROR: Object Required???
Set chrt = Pict.chart

SaveLoc = ThisWorkbook.Path & Application.PathSeparator & "Chart"
& ".gif"
chrt.Export Filename:=SaveLoc, FilterName:="GIF"

'Clear chart variable
Set chrt = Nothing

PowerWord2

End Sub