I have the following code:
Sub Excel2Word()
Dim BottomEquity As Range, BottomBond As Range
Dim WordApp As Word.Application
Set SB = Worksheets("SalesBrokerage")
Set WordApp = CreateObject("Word.Application")
WordApp.Documents.Open "C:\Customer\Templates\PIntern.dotx"
SB.Range("B3:G" & SB.Cells(SB.Rows.Count, 2).End(xlUp).Offset(1, 0).Row).Select
Selection.PasteExcelTable
HorizontalPosition = 10
VerticalPosition = 15
End Sub
I always get problems at Selection.PasteExcelTable
and obviously the HorizontalPosition
and VerticalPosition
won't be true either.
The Word Template that I want to paste into looks like the following:
Our Overview
Equities
Bonds
I want to do the equivalent of copying the selected range in my Excel document, opening the Word template, pasting the table between "equities" and "bonds" and then saving the document.