0

I'm new to vb so it is no surprise that I am stuck. I have this code and it runs as it should but I get a the Error "Run-time error '91: Object variable or With block variable not set". How can I fix this and have it continue on to the rest of my code.
Thank You,
DS

 Do
        Selection.Rows(1).Next.Select
        Selection.Cells(5).Select
        Selection.FormFields.Add Range:=Selection.Range, Type:= _
        wdFieldFormTextInput

        If Selection.Information(wdWithInTable) = True Then
        End If

   Loop Until Selection.Information(wdWithInTable) = False
4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by Unhnd_Exception
0

Incorrect. This is a perfectly valid implementation of a do loop. It is valid (and sometimes desirable) to put the test at the bottom of the loop.

1

My down vote got cut off. So I had to finish it with a post.

@ret801

Heres an excerpt from the directions on a while statement. This comes from Microsoft. Not some wanna be website: a.k.a. java2s.com. Maybe you should find some better resources.

Do { While | Until } condition
    [ statements ]
    [ Exit Do ]
    [ statements ]
Loop
-or-
Do
    [ statements ]
    [ Exit Do ]
    [ statements ]
Loop { While | Until } condition
Votes + Comments
nice and complete reply
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.