Paste Method of Worksheet Failed When Copying Chart Object

L

Larry

In a VBA macro for Excel, I have some code that works for awhile and
then bombs with the Error of a Past Method Worksheet Failed. I'm
essentially running through a series of products and producing 6
charts for each product on a sheet. The 6 charts are pre-made and
have specific names assigned to them so I can easily copy them to the
newest sheet.

The error is not too descriptive, but I'm guessing the chart was never
copied. Possibly due to lack of memory. I've tried using
Application.CutCopyMode = False to dump memory, but that does not seem
to work.

Any guidance on this error would be much appreciated.

For cht = 1 To 6
Select Case cht
Case 1
GRAPH_TYPE = "DueTo_CHT"
'sheigth = 1.14
'swidth = 1.5
Sheets("STD_GRAPHS").ChartObjects("DueTo_CHT").Copy
Sheets("temp_sheet").Paste
----------------------------------------------->Error occurs here
Application.CutCopyMode = False
With Sheets("temp_sheet").Shapes("DueTo_CHT")


Regards,

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top