I'm trying to copy text and charts from Excel to Word. The problem is that the chart is always appearing on top of the Word document. How can I add the chart at the end of the Word document? Here is my code:
Sub Test()
Dim tbl As Excel.Range
Dim WordApp As Word.Application
Dim myDoc As Word.Document
Dim WordTable As Word.Table
Set WordApp = GetObject(class:="Word.Application")
WordApp.Visible = True
WordApp.Activate
'Create a New Document
Set myDoc = WordApp.Documents.Add
'Copy Excel Text in cell A1 to A3
Worksheets("Rapportage").Select
Range("A1:A3").Select
Selection.Copy
'Paste Excel Text into MS Word
myDoc.Paragraphs(1).Range.PasteExcelTable LinkedToExcel:=False, WordFormatting:=False, RTF:=False
'Copy Excel Chart
Worksheets("Rapportage").Select
Range("A4").Select
Selection.Copy
'Paste Chart into MS Word
myDoc.Paragraphs(1).Range.PasteExcelTable LinkedToExcel:=False, WordFormatting:=False, RTF:=False
End Sub
myDoc.Paragraphs(1).Range.PasteExcelTable
I imagine the syntax should be something likemyDoc.Paragraphs(myDoc.Paragraphs.Count+1).Range.PasteExcelTable
– Marcucciboy2