Hi all,
Ive recorded some code but im struggling with the error handler.
Basicly I have some code which is in a do - loop. Its quite a lot of code so no point putting it all in as it wouldn’t mean anything to any one.
Here is the starting code.
Basicly it opens up a hyperlink and copies the content from within it and then closes it again. It keeps doing this until it gets to the bottom of the list.
My problem is that if the hyperlink that it trys to follow doesnt exsist it ends my Macro.
what ive tryed to do is insert a error handler at the point where it follows the hyperlink to say "If there is a error when opening move down 1 cell.
My issue is this..."
My error handler says this
But then my code ends and it doesnt carry on with the loop it just ends my code.
What i would like to happen is that when there is a error when trying to follow the hyperlink it just restarts just before the "Do" comment. This would move it down to the next line and carry on. Ive tried using the ON ERROR GO TO statement but that doesnt seem to work.
The other issue is when the code finishes runing it will still pass through the error handler which will sent it back up to the DO comment and create a loop??
Can anyone help??
UPDATE......
I put the error handler above the DO which did work but it will only work once. If the Hyperlink does not exist it will start before the DO comment but then if it has anouther Hyperlink that doesnt work it says cannot find file. Its as if it can only do 1 error :/
Bookmarks