No Resume Error

I am running this agent & getting error “No Resume” and line at which it occurs is line 23 in my code. I am trying to find group to which user belongs to & display it in msgbox + count and display number of Group documents user is in.


Declarations

Dim s As NotesSession

Dim sourcenote As NotesDocument

Dim sourceview As NotesView

Dim nextnote As NotesDocument

Dim DocsUpdated As Integer

Dim item As NotesItem

Dim key As String


Sub Initialize

Set s = New NotesSession

Dim key As String

On Error Goto Errhandle	



Set sourcedb = s.CurrentDatabase	

Set sourceview = sourcedb.GetView("($VIMGroups)")	

DocsUpdated = 0

'Mention user name here

key = Lcase("CN=Ashok Nawani/O=Fiberlink")

Msgbox " Entry to search is  " + key

Set sourcenote = sourceview.GetFirstDocument()



While Not(sourcenote Is Nothing)

	

	Print "Group document is " & sourcenote.listname(0)

’ Msgbox "Group document is " + sourcenote.listname(0)

	'Set		nextnote = sourceview.Getnextdocument(sourcenote)	

	Set item = sourcenote.GetFirstItem("Members")

	

	Forall v In item.values			

		If key = Lcase(v) Then

			Msgbox "Found in Group Document " + sourcenote.listname(0)

			DocsUpdated = DocsUpdated + 1	

		End If

	End Forall

’ Loop to next document

’ Set sourcenote = nextnote

	Set	sourcenote = sourceview.Getnextdocument(sourcenote)	

	

Wend		



Msgbox " Total Group Documents User Belongs To  " & DocsUpdated

'Trap the details of the error in server log file

Errhandle:

Print "Error number " & Err & ": " & Error$ & Chr(10) + Chr(13) & " This error occurred at line number  " & Erl	

End Sub

Subject: No Resume Error…

I am not getting "no resume: error now but my msgbox indicating total number of group documents user is in, still not gets displayed.*****************************

Wend

Msgbox " Total Group Documents User Belongs To  " &  DocsUpdated



Exit Sub

'Trap the details of the error in server log file

Errhandle:

Print "Error number " & Err & ": " & Error$ & Chr(10) + Chr(13) & " This error occurred at line number  " & Erl	

Exit Sub 

End Sub


Subject: No Resume Error…

Ashok,.

You need an “Exit Sub” line after your last msgbox (before the erehandle section).

The code is going into the errhandle section at the end

Mike

Subject: RE: No Resume Error…

I did include Exit Sub as below & still get error “No Resume” it is not reaching code for last msgbox:************************

Wend

Msgbox " Total Group Documents User Belongs To  " & DocsUpdated



Exit Sub

Thanks for your help

Subject: RE: No Resume Error…

According to the documentation, you should end your error handling routine with Resume, Exit Sub, Exit Property, or Exit Function. If the last messagebox isn’t appearing then there’s an error in your script. Comment out the error handling and step through the script until it crashes.