Dim xlFilename As String
xlFilename = Inputbox$("Please enter the path of the Excel File you Wish to Import") '// This is the name of the Excel file that will be imported
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = New NotesDocument(db)
Dim One As String
Dim row As Integer
Dim written As Integer
Dim number As Integer
number=Inputbox$("Number of rows in spreadsheet") 
'// Next we connect to Excel and open the file. Then start pulling over the records.
Dim Excel As Variant
Dim xlWorkbook As Variant
Dim xlSheet As Variant
Print "Connecting to Excel..."
Set Excel = CreateObject( "Excel.Application.9" )
Excel.Visible = False '// Don't display the Excel window
Print "Opening " & xlFilename & "..."
Excel.Workbooks.Open xlFilename '// Open the Excel file
Set xlWorkbook = Excel.ActiveWorkbook
Set xlSheet = xlWorkbook.ActiveSheet
row = 0 '// These integers intialize to zero anyway
written = 0
Print "Starting import from Excel file..."
While written=<number
With xlSheet
row = row + 1
Set view = db.GetView("By Category")
Set doc = db.CreateDocument '// Create a new doc 
doc.Form = "New Document" 
doc.Name = .Cells( row, 1 ).Value
doc.Street = .Cells(row, 2).Value
doc.City = .Cells( row, 3 ).Value
doc.Zip = .Cells(row, 4).Value
doc.phone = .Cells( row, 5).Value
' doc.Category="CategoryHardcoded"
doc.phone = .Cells( row, 5).Value
Call doc.Save( True, False ) '// Save the new doc
written=written+1
Wend

End If
End With
Print "Disconnecting from Excel.."
excel.quit