+ Reply to Thread
Results 1 to 4 of 4

CopyPicture ?????

  1. #1
    Paul Smith
    Guest

    CopyPicture ?????

    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



  2. #2
    John Mansfield
    Guest

    RE: CopyPicture ?????

    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

    ----
    Regards,
    John Mansfield
    http://www.pdbook.com

    "Paul Smith" wrote:

    > 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
    >
    >
    >


  3. #3
    Paul Smith
    Guest

    Re: CopyPicture ?????

    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




    "John Mansfield" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >
    > ----
    > Regards,
    > John Mansfield
    > http://www.pdbook.com
    >
    > "Paul Smith" wrote:
    >
    >> 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
    >>
    >>
    >>




  4. #4
    Jon Peltier
    Guest

    Re: CopyPicture ?????

    Paul -

    The PowerPoint FAQ calls it a problem when Excel content is pasted into
    PowerPoint, but I think it can happen just in Excel. This page has some
    info about it:

    http://www.rdpslides.com/pptfaq/FAQ00068.htm

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    Paul Smith wrote:

    > 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
    >
    >
    >
    >
    > "John Mansfield" <[email protected]> wrote in message
    > news:[email protected]...
    >
    >>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
    >>
    >>----
    >>Regards,
    >>John Mansfield
    >>http://www.pdbook.com
    >>
    >>"Paul Smith" wrote:
    >>
    >>
    >>>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
    >>>
    >>>
    >>>

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1