CopyPicture ?????

P

Paul Smith

What on earth is happening with th code below??????

The code works fine, copying a chartobject and pasting it into a new
location. The problem is that while the chart area is the same size, only
two thirds of the image is copied.

I will say that I have stretched the plot area of the original, it itself
does not behave strangely.

I have no idea what the problem is, does any one else?


Code Snippet:
ThisWorkbook.Activate

Worksheets("Summary").Activate

Range("A30").Select

ActiveSheet.ChartObjects("First Chart").CopyPicture xlScreen, xlBitmap

Workbooks(TargetWB).Activate

Worksheets("Summary").Activate

Range("A31").Select

ActiveSheet.Paste
 
J

John Mansfield

Paul, would this revision work for you? It assumes you don't need the
reference to the .bmp file to copy the picture:

Sub CopyChart()
ActiveSheet.ChartObjects("First Chart").Activate
ActiveChart.ChartArea.Select
ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlScreen, Format:= _
xlPicture
Range("A31").Select
ActiveSheet.Pictures.Paste.Select
End Sub
 
P

Paul Smith

John,

Thanks for your suggestion but it makes no difference.

The problem seems to be when the charts is stretched wider than a certain
ratio of the original.

This problem is very very frustrating, so if anyone else has any solution
please let me know.

Paul Smith
 

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