daviddiebel
asked on
Replace all charts with pictures on a worksheet?
I'm trying to copy all charts on a worksheet as pictures, and then delete all of the original charts. What I have for code right now is:
Sub ConvertCharttoPicture()
Dim i As Integer
Dim intX As Integer
For i = 1 To ActiveSheet.ChartObjects.C ount
ActiveSheet.ChartObjects(i ).Activate
ActiveSheet.ChartObjects(i ).Select
ActiveChart.ChartArea.Sele ct
ActiveChart.CopyPicture _
Appearance:=xlPrinter, Size:=xlScreen, Format:= _
xlPicture
ActiveChart.Paste
Next
End Sub
One problem is that I cannot figure out how to delete the original chart. The second problem is that this loops indefinitely, going over the same chart, again and again. Any assistance at making this work would be great! I intend to use this on many, many worksheets as part of another macro.
Thank you!
Sub ConvertCharttoPicture()
Dim i As Integer
Dim intX As Integer
For i = 1 To ActiveSheet.ChartObjects.C
ActiveSheet.ChartObjects(i
ActiveSheet.ChartObjects(i
ActiveChart.ChartArea.Sele
ActiveChart.CopyPicture _
Appearance:=xlPrinter, Size:=xlScreen, Format:= _
xlPicture
ActiveChart.Paste
Next
End Sub
One problem is that I cannot figure out how to delete the original chart. The second problem is that this loops indefinitely, going over the same chart, again and again. Any assistance at making this work would be great! I intend to use this on many, many worksheets as part of another macro.
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you - perfect!
ActiveSheet.ChartObjects(i