tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
This is the code I use to copy a chart from one worksheet to another:
The program crashes with the error message:
I click Debug and it points to this line:
but when I click F5 to continue, it runs until then end of the code. Normally if there's an error, it shouldn't let you continue.
Can someone explain what is wrong?
Thanks
Code:
Set ch = Sheet1.ChartObjects("Chart")
ch.Copy
Sheet2.Paste Destination:=Sheet2.Cells(1, 1)
The program crashes with the error message:
Code:
run-time error '1004':
Method 'Paste' of object'_worksheet' failed
I click Debug and it points to this line:
Code:
Sheet2.Paste Destination:=Sheet2.Cells(1, 1)
but when I click F5 to continue, it runs until then end of the code. Normally if there's an error, it shouldn't let you continue.
Can someone explain what is wrong?
Thanks