Hello,
I am trying to create a macro in Excel that will copy a graph on the current worksheet and paste it in a particular area on another worksheet (all within the same workbook).
I receive the following VB error:
Run-time error '1004': Unable to get the ChartObjects property of the Worksheet class.
Is there something that I am doing wrong or some way I need to call the new copied graph when I paste it?
Thanks so much for your help,
Tom
Here is the Macro code:
Sub COPY_and_PASTE_GRAPH()
'
' COPY_and_PASTE_GRAPH Macro
' Keyboard Shortcut: Ctrl+g
'
ActiveSheet.ChartObjects("Chart 13"
.Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveWindow.Visible = False
Windows("SAMPLE Program Summary Status Roll-Up_V1.1.xls"
.Activate
Sheets("MASTER PROGRAM STATUS"
.Select
Range("H26"
.Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart 96"
.Activate
ActiveSheet.Shapes("Chart 96"
.IncrementLeft 7.5
ActiveSheet.Shapes("Chart 96"
.IncrementTop 3#
End Sub
I am trying to create a macro in Excel that will copy a graph on the current worksheet and paste it in a particular area on another worksheet (all within the same workbook).
I receive the following VB error:
Run-time error '1004': Unable to get the ChartObjects property of the Worksheet class.
Is there something that I am doing wrong or some way I need to call the new copied graph when I paste it?
Thanks so much for your help,
Tom
Here is the Macro code:
Sub COPY_and_PASTE_GRAPH()
'
' COPY_and_PASTE_GRAPH Macro
' Keyboard Shortcut: Ctrl+g
'
ActiveSheet.ChartObjects("Chart 13"
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveWindow.Visible = False
Windows("SAMPLE Program Summary Status Roll-Up_V1.1.xls"
Sheets("MASTER PROGRAM STATUS"
Range("H26"
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart 96"
ActiveSheet.Shapes("Chart 96"
ActiveSheet.Shapes("Chart 96"
End Sub