Maybe it is known and documented but this is the first time I've encountered this oddity:
Sub ScratchMacroOddity()
'A basic Word macro coded by Greg Maxey
Dim lngIndex As Long
Dim oTbl As Word.Table
'Add a 3x3 table
Set oTbl = ActiveDocument.Tables.Add(Selection.Range, 3, 3)
On Error GoTo Err_NoRow
For lngIndex = 1 To 5
'I would expect a RTE 5941 - The requested memeber of the collection does not exist, but it doesn't occur.
oTbl.Cell(lngIndex, 1).Range.Text = lngIndex & "-1"
oTbl.Cell(lngIndex, 2).Range.Text = lngIndex & "-2"
oTbl.Cell(lngIndex, 3).Range.Text = lngIndex & "-3"
'Even though rows 4 and 5 don't exists the data is written to the "last" row.
Next lngIndex
lbl_Exit:
Exit Sub
Err_NoRow:
oTbl.Rows.Add
Resume
End Sub
Sub ScratchMacroWorking()
'A basic Word macro coded by Greg Maxey
Dim lngIndex As Long
Dim oTbl As Word.Table
Set oTbl = ActiveDocument.Tables.Add(Selection.Range, 3, 3)
On Error GoTo Err_NoRow
For lngIndex = 1 To 5
oTbl.Rows(lngIndex).Cells(1).Range.Text = lngIndex & "-1"
oTbl.Rows(lngIndex).Cells(2).Range.Text = lngIndex & "-2"
oTbl.Rows(lngIndex).Cells(3).Range.Text = lngIndex & "-3"
Next lngIndex
lbl_Exit:
Exit Sub
Err_NoRow:
MsgBox Err.Number & " " & Err.Description
oTbl.Rows.Add
Resume
End Sub