J
Jack
I have 5 tables all the same size 5 rows by 7 columns. I have another
separate table called tblSub that I want to insert into any two empty cells
of each of the 5 main tables .
My code is as follows:
**********
Set tblSub = ActiveDocument.Tables(6)
tblSub.Select
Selection.Copy
For it = 1 To 5
iSubCount = 0
For Each oCell In ActiveDocument.Tables(it).Range.Cells
If oCell.Range.Text = Chr(13) & Chr(7) Then
'Cell is empty, store subtable
iSubCount = iSubCount + 1
oCell.Range.PasteAsNestedTable
If iSubCount = 2 Then Exit For
End If
Next oCell
Next it
*********
This code works correctly for 3 inserts. When it=2 and isubcount=2, I get
the run time error 4605 "The command is not available"
The command "pasteasnestedtable" is the culprit.
Each table does have at least two empty cells.
Any suggestions?
Jack
separate table called tblSub that I want to insert into any two empty cells
of each of the 5 main tables .
My code is as follows:
**********
Set tblSub = ActiveDocument.Tables(6)
tblSub.Select
Selection.Copy
For it = 1 To 5
iSubCount = 0
For Each oCell In ActiveDocument.Tables(it).Range.Cells
If oCell.Range.Text = Chr(13) & Chr(7) Then
'Cell is empty, store subtable
iSubCount = iSubCount + 1
oCell.Range.PasteAsNestedTable
If iSubCount = 2 Then Exit For
End If
Next oCell
Next it
*********
This code works correctly for 3 inserts. When it=2 and isubcount=2, I get
the run time error 4605 "The command is not available"
The command "pasteasnestedtable" is the culprit.
Each table does have at least two empty cells.
Any suggestions?
Jack