<p>Can you please clarify the folowing query? I am not sure if the way I am trying to code is correct. Kindly advise me if I am moving in the right/wrong direction.</p>

<p>I am trying to develop an automation framework using <a href="http://en.wikipedia.org/wiki/HP_QuickTest_Professional" rel="nofollow noreferrer">QuickTest Professional</a>, a testing tool.</p>

<ul>
<li>There is an Excel sheet from which the data is being taken for execution based on the ID's stored in an array from another Excel sheet (The same ID is available in both Excel sheets).</li>
<li>I'm trying to handle the exeptional cases through a function call. This function will capture the screenshot of the page error occured and then exit the entire loop.</li>
<li>I need a scenario where execution continues for the next ID stored in the array, and this needs to be handled from the function call.</li>
</ul>

Well, it sounds like you already have the answer.. You just need to handle the expection that occurs when reading in the data within the main loop and make it stop there..
Now, I have not done VBScript for a LONG time so, to pseudo it:
```
```
While Not EndOfExcelSheet
    ReadDataFromExcel();
    If errOccurred Then TakeScreenPrint();
    'NOTE: We have caught the error and requested the screen print
    'is taken, but we have NOT bubbled the exception up!
End While
```
```