Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2008, 08:15 PM
kiwichico kiwichico is offline
Novice
Reset on error
 
Join Date: Sep 2008
Posts: 1
kiwichico is on a distinguished road
Default Reset on error

Hi all,

I am trying to exit a loop or go to a certain place in the procedure once an error has been found. It works fine on the first iteration but the second time it doesn't recognise the on error commmand. Below is the piece of code. thanks in advance.

Sub FindTable()
startloop:

'Find first table


Selection.GoTo What:=wdGoToTable, Which:=wdGoToFirst, Count:=1, Name:=""

'If can not find any more tables exit loop
On Error GoTo endloop:
Selection.Tables(1).Cell(1, 1).Select

'If can not find row 2 column 3 go to local handler
On Error GoTo LocalHandler:
Selection.Tables(1).Cell(2, 3).Select

LocalHandler:

'Reset on error
On Error GoTo 0

GoTo startloop:
endloop:
End Sub
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re-installing Office - reset Product Key? Knights Office 1 05-21-2009 02:36 PM
Reset on error Page opens at 175% zoom. How can I reset the default? Renee Hendershott Word 2 01-22-2006 06:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft