Exporting chartsheets and breaking links

  • Thread starter Thread starter ExcelMonkey
  • Start date Start date
E

ExcelMonkey

Is it possible to export chartsheets and break their links. I have in
the past exported all the chartsheets from Workbook1 as Gifs and placed
them in Workbook2. The result is that all the charts get copied as
Gifs and then placed in Workbook2 in succession (i.e. vertically down
the 1 sheet).

The problem with copying them as Gifs is that you cannot click onto the
series after the fact. Furthermore, since they are all on the same
sheet, the user has to scroll down to view them. I want to copy the
chartsheet and then export it as chart sheet (not gif) into Workbook2.
Final result will be a new workbook with its own chartsheets with no
links.

Can this be done?
 
Correct me if I am wrong but this only tells me how to break the links
of the series. So I still need to copy sheet from workbook1 to
workbook2. Furthermore, I sometimes use cell links for my titles.
Does this break the links for the cell links as well?
 
Yes, what I posted breaks series links. To unlink the titles, you'd need
something like this:

Sub UnlinkTitles()
Dim iAx As Integer, iGrp As Integer
With ActiveChart
If .HasTitle Then .ChartTitle.Text = .ChartTitle.Text
For iAx = 1 To 2
For iGrp = 1 To 2
If .HasAxis(iAx, iGrp) Then
With .Axes(iAx, iGrp)
If .HasTitle Then _
.AxisTitle.Text = .AxisTitle.Text
End With
End If
Next
Next
End With
End Sub

Copying the chart sheet is straightforward:

Sheets("Chart1").Copy Before:=Workbooks("OtherBook.xls").Sheets(1)

You can record a macro to find out things like this. In fact, that's
what I did, so I didn't mess up the syntax.

- Jon
 
Back
Top