Please excuse what is probably a simple answer - I am very new at VBA. I am using VBA in Excel and attempting to write to a Word document. The document is to have a few lines of text followed by a 6x6 table. When I do a:
Set tableNew = .Tables.Add(.Range, 6, 6)
it overwrites the previous lines I wrote. I'm sure there's a way to place this table in the appropriate spot in the document, but I've been unable to find any documentation on this.
Can you offer any help with this
Thanks, kgkidd

Adding table in Word Doc over writes previous lines
craigman
Daudi
Sub AddTable()
Dim rng As Range
Dim tbl As Table
'set rng to first paragraph
Set rng = ActiveDocument.Range(Start:=ActiveDocument.Paragraphs(1).Range.Start, _
End:=ActiveDocument.Paragraphs(1).Range.End)
rng.Collapse direction:=wdCollapseEnd
Set tbl = ActiveDocument.Tables.Add(rng, 6, 6) 'insert table after paragraph
End Sub