'Copying Chart Objects failed - VBA glitch?
I run a program that executes a series of macros to manipulate raw data into various charts and graphs. The master macro runs about 15 macros in order. Everything works about 50% of the time. The code to copy all my charts and put them into one sheet is the bottleneck. It works half the time and the other half I get the following error:
"Method of Copy Object Chart Object failed."
See code below. Open to any and all suggestions, I am stumped!
Sub CopyCharts()
Dim Sheet_Count As Integer
Dim Target_Sheet As Worksheet
Dim i As Integer
Dim Cht As ChartObject
Sheet_Count = ActiveWorkbook.Sheets.Count
Set Target_Sheet = ActiveWorkbook.Sheets(4)
For i = 5 To 16
For Each Cht In ActiveWorkbook.Sheets(i).ChartObjects
Cht.Copy
Target_Sheet.Paste Target_Sheet.Range("D4")
Next Cht
Next i
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
