Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

"On Error Exit Do" is compile error??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed - 15 Nov 2004 13:40 GMT
I created a Do Loop, then made my first statement after Do to be "On Error
Exit Do".  But it highlights in red and gives me a compile error: "Expected:
GoTo or Resume".  What did I do wrong?  How do I do it right?

Ed
Jonathan West - 15 Nov 2004 14:37 GMT
>I created a Do Loop, then made my first statement after Do to be "On Error
> Exit Do".  But it highlights in red and gives me a compile error:
> "Expected:
> GoTo or Resume".  What did I do wrong?  How do I do it right?

Hi Ed,

The only forms that the On Error command can follow are as follows

On Error Resume
On Error Resume Next
On Error Goto label

where label is the name of a label elsewere in the routine

You need to do something like this

Do While SomeCondition
 On Error Goto dropout
 'your code goes here
Loop
dropout:
'more code follows here

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Ed - 15 Nov 2004 15:08 GMT
Thank you.  I had remembered seeing the "Exit" (For, Do If) statements used,
but didn't quite remember how.  I will do something else then.  I appreciate
the help.

Ed

> >I created a Do Loop, then made my first statement after Do to be "On Error
> > Exit Do".  But it highlights in red and gives me a compile error:
[quoted text clipped - 19 lines]
> dropout:
> 'more code follows here

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.