Hallo,

wie kann ich die Position einer Tabelle im Word Dokument mittels VBA verändern? WEnn ich bei Range(0) einen anderen Wert als Null eintrage bekomme ich eine Fehlermeldung..

Dim appWord As Word.Application
Dim i As Integer, k As Integer
Dim tb As Word.Table

ThisWorkbook.Worksheets("Tabelle2").Activate

' Anwendung Word starten
Set appWord = CreateObject("Word.Application")

' Neues Word-Dokument erstellen
appWord.Documents.Add

' Neue Tabelle erstellen, mit Rahmen innen und außen
Set tb = appWord.ActiveDocument.Tables.Add _
(appWord.ActiveDocument.Range(0), 3, 5)
tb.Borders.InsideLineStyle = wdLineStyleSingle
tb.Borders.OutsideLineStyle = wdLineStyleSingle

For i = 1 To 3
For k = 1 To 5
' Tabellenzelle mit Text aus Excel-Zelle füllen
tb.Cell(i, k).Range.Text = Cells(i, k).Value
Next k
Next i

' Word-Dokument speichern mit Dateiname
appWord.ActiveDocument.SaveAs ThisWorkbook.Path _
& "\ausdaten.doc"

' Anwendung Word beenden
appWord.Quit

Grüße riccle!