No error on table cell range

D

David Sisson

Sub Test()
Dim Rng As Range
'No error if table has less than 9 rows
Set Rng = ActiveDocument.Tables(1).Cell(9, 1).Range
Rng.MoveEnd wdCharacter, -1
Rng.InsertAfter "Row 9"
End Sub

This does not generate an error when the table has less than 9 rows as
I would expect. It simply puts the test in the last row, col 1.

What am I missing?
 
S

Stefan Blom

As far as I can tell, you are not missing anything. I get the same result:
no error message. Note, however, that .Cell(1, 9).Range used for a table
with fewer than 9 *columns*, does generate an error message.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
D

David Sisson

Interesting... kinda killed my whole error trapping routine. :p

Guess I'll have to rethink this one.

Thanks for the comment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top