Export to Excel uncorrectable error

Following code create uncorrectable errorLookupHandle:Null handle this case by Set xlApp = CreateObject(“excel.application”)

How to solve ?

Sub Initialize

’ Create a document collection from selected docs

’ Move doc collection to a folder

’ Process items in the folder as a view entry

’ Remove from folder

Dim session As New NotesSession

Dim db As NotesDatabase 

Dim dc As NotesDocumentCollection

Dim view As NotesView

Dim vc As NotesViewEntryCollection

Dim entry As NotesViewEntry

Dim doc As NotesDocument

Dim x As Integer

Dim cp As Integer ' used to count the offset position of the columns

Dim xlApp As Variant

x=1 ' used to count the number of the selected document

cp=0



Set db = session.CurrentDatabase

If (db Is Nothing) Then Goto endofsub 

Set dc = db.UnprocessedDocuments ' gets a handle on the documents you selected

Set view =db.GetView("Outstanding")

If view Is Nothing Then

	Msgbox "View not found"

	Goto endofsub	

End If

Set vc = view.AllEntries 

Set xlApp = CreateObject("excel.application")

Set xlapp = Nothing

’ since selected documents are not processed in the order that they are displayed in the view

’ i move the selected documents to their own “sorted” folder, and then process all of them from there

Call dc.PutAllInFolder( "temp" ) ' moves those selected documents into a folder

Call dc.RemoveAllfromFolder("temp")

endofsub:

’ place any wrap up stuff here

End Sub