DXL Exporter throwing an error

Hi…I am trying to export all the databases design in a directory using DXL Export option. First database is getting exported, but it gives an error from second database when using directory databases. The error is coming in below line.

tOutput = exporter.Export(db)

The error message is ‘DXL exporter input object is invalid, uninitialized or not explicitely displayed’

Below is the complete code.

Sub Initialize

On Error GoTo erhandlr



Dim session As New NotesSession

Dim db As NotesDatabase



Dim tOutput As String



Dim filenum As Integer 

Dim dbdir As New NotesDbDirectory("")	

Set db = dbdir.GetFirstDatabase(DATABASE)

While Not(db Is Nothing)

	MsgBox db.Title

	If db.Open( "", db.Title+".nsf" ) Then			

	End If

	

	'Set db = session.GetDatabase("", "names", False)

	Dim exporter As NotesDXLExporter

	Set exporter = session.CreateDXLExporter		

	tOutput = exporter.Export(db)

	filenum = FreeFile

	Open "C:\dxl\Test\"+db.Title+".dxl" For output As filenum

	Write #filenum, tOutput

	Close filenum

	

	Set db = dbdir.GetNextDatabase

Wend



Exit Sub

erhandlr:

MsgBox Error() & " Line " & Erl()

Exit Sub

End Sub

Please help to access all the databases in a directory (local or server) and export the design of all databases at one go.

Subject: What line number does the error happen?DXL Exporter throwing an error

Your error handler shows the line number, but you haven’t posted that.