LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 296
Default Trapping an invalid email error in Excel VBA code

Hi,

I have a list of email names in a worksheet
I also have a subroutine which loops through these names, creates an
Outlook email with the "OLMail.Send" command, and sends the message.

Where the email name is not recognised by Outlook, an error is
returned and the macro halts. I'd now like to build some error
trapping code into the macro so that the invalid email name is marked
accordingly and the subroutine then carries on looping.

I can see thatan On Error Goto command can send program control to an
error handling routine at the end of the subroutine, but as this is
outside the For..Next loop, once the error is handled the macro stops.

Can anyone suggest an alternative approach? Is there such a thing as
an OnError redirection command which could call another subroutine and
then return back to the loop?

TIA

Rgds


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
EXCEL ERROR: This workbook contains INVALID references. ? Boswell[_2_] Excel Discussion (Misc queries) 0 February 27th 10 02:28 AM
How to Sort Invalid Email Addresses? la90292 New Users to Excel 10 February 10th 06 05:36 AM
Error trapping Luis Excel Programming 1 November 11th 04 03:25 AM
Error Trapping Options Change in Excel 1997 Frank DeLuccia Excel Programming 0 April 28th 04 11:08 PM


All times are GMT +1. The time now is 05:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"