[Solved] VBA: Copying Excel Chart

  • I'm trying to copy a chart in Excel and paste it in Word using VBA. The chart has a selected range on a worksheet. I've searched and read that the chart can be copied over as a ".gif" file. Is there any other ways of doing this? I've selected the range and copy the selection but what is the syntax to pasting it to Word?

  • Remember that when you are working with the WORD document from within your EXCEL macro, that you need to use WORD macro commands. The following were recorded in WORD while I pasted in a chart I had copied while in EXCEL. The first macro (Marco2) pastes as a picture and the second (Macro3) as a MS object.


    Sub Macro2()
    '
    ' Macro2 Macro
    ' Macro recorded 08/18/03 by Workgroup
    '
    Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, _
    Placement:=wdFloatOverText, DisplayAsIcon:=False
    End Sub
    Sub Macro3()
    '
    ' Macro3 Macro
    ' Macro recorded 08/18/03 by Workgroup
    '
    Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, Placement _
    :=wdFloatOverText, DisplayAsIcon:=False
    End Sub



    Hope this helps.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!