Notes Error:LookupHandle:handle not allocated

Hi Experts,

Occuring one error msg “Error: Notes error: LookupHandle: handle not allocated (By\Email Not Complete) Error Code: 4005”

Line 32 : Call view.Refresh

Can anyone help on this.

code:

Sub UpdateView

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim newDoc As NotesDocument

Dim doc As NotesDocument

Dim MsgLog As LogActionClass

Dim Msgtext As String

Dim Module As String

Set MsgLog = New LogActionClass

Module = “FileUtitlities- UpdateView”

Call MsgLog.SetFromParameters

On Error Goto ErrorInUpdateView

Set db = session.CurrentDatabase

Set view = db.GetView( “ByEmailNotComplete” )

If view Is Nothing Then

Msgtext = “An Unexpected Error has occured.” & Chr$(10) & _

“Please contact technical support with the following diagnostic information: No View” & Chr$(10) & _

		"Error: " & Error$ & " Error Code: " & Err()

		Call MsgLog.LogFatalError(msgtext,Erl(),Module)

		

		Else

		Call view.Refresh

		End If

Exit Sub

ErrorInUpdateView:

Msgtext = "An Unexpected Error has occured." & Chr$(10) & _

"Please contact technical support with the following diagnostic information:" & Chr$(10) & _

"Error: " & Error$ & " Error Code: " & Err()

Call MsgLog.LogFatalError(msgtext,Erl(),Module)

Exit Sub

End Sub

Subject: Notes Error:LookupHandle:handle not allocated

I take you check if the view is there. Perhaps it is corrupt or has a role assigned. You would think it would fail on view is nothing

Subject: RE: Notes Error:LookupHandle:handle not allocated

Thanks Barry for your help !!!Yes view is there.I create a new same view and let you know the result.