Exporting tables to Word via variables

G

Gromit

Hi,

I need to export many excel ranges to a Word document (Office 2000),
which I'd like to appear in HTML formal (i.e. not as pictures).

So far I've figured out how to send over single cell contents using
Word's Selection.TypeText method (See SheetName variable below).

However, I'm stumped when it comes to sending over a range of excel
cells to become a Word table (See MonthTotals variable below)

Any help much appreciated!!!!

Thanks,

Graham

Sub ExportToWord()
Dim WordApp As Object
Set WordApp = GetObject(, "Word.Application")
Set SheetName = Sheets("1-RHCeVT0").Range("D2")
Set MonthTotals = Sheets("1-RHCeVT0").Range("A45:G59")


With WordApp.Selection
.GoTo What:=wdGoToBookmark, Name:="OLE_LINK1"
.TypeText Text:="Scenario: " & SheetName
.TypeParagraph

End With
WordApp.ActiveDocument.Tables.Add Range:=Selection, NumRows:=7,
NumColumns:=14 '??????


End Sub
 
Top