Sub Initialize ' this function imports data from excel to Notes ' Customizations: ' 1. You may need to update the CreateObject to the version of excel you have installed. (Change 9 to 8 or to 10, etc.) ' 2. Update the fields to pull in the cells are number from left to right. A=1, B=2, etc. ' 3. Change the filename to import below to the one you want to get. Dim xlFilename As String ' filepath/name of excel file to import Dim ans As String ' answer to dialog questions xlFilename = "c:\temp\temp.xls" ' <-- CUSTOMIZE THIS ' notes side dims Dim session As New NotesSession Dim db As NotesDatabase Dim view As NotesView Dim doc As NotesDocument Dim fldDate As NotesDateTime ' excel counting dims Dim row As Long Dim written As Long ' excel dims Dim Excel As Variant Dim xlWorkbook As Variant Dim xlSheet As Variant ' setup environment Set db = session.CurrentDatabase Set doc = New NotesDocument(db) ' connect to Excel and open the file. Then start pulling over the records. 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 ' open the active (last used) sheet in workbook ' cycle through the rows of the Excel file, pulling the data over to Notes row = 0 '// These integers intialize to zero anyway written = 0 Print "Starting import from Excel file..." Do While True Finish: With xlSheet row = row + 1 Set view = db.GetView("Import") Set doc = db.CreateDocument '// Create a new doc ' CUSTOMIZE BEGINNING HERE doc.Form = "MyFormName" doc.FieldOne = Cstr(.Cells( row, 1 ).Value) ' Cstr - use to convert say a number column to text doc.FieldTwo = .Cells(row, 2 ).Value doc.FieldThree = .Cells(row, 3).Value doc.FieldFour = .Cells( row, 4 ).Value doc.FieldFive = .Cells(row, 5).Value doc.FieldSix = .Cells( row, 6).Value Set fldDate=New NotesDateTime(Cstr(.Cells( row, 6).Value)) Call doc.ReplaceItemValue("FieldDateSix", fldDate) doc.FieldSeven = Cstr(.Cells(row, 7).Value) ' add other static Notes-side fields doc.OtherField = "Yes" ' save doc Call doc.Save( True, False ) ' force, no rep conflict written = written + 1 If written = 500 Then Print Cstr(row) & " records." ans$ = Inputbox$("Do you want to continue, Y/N?") If ans$ = "Y" Or ans$ ="y" Then ' continue written=0 Else Goto Done End If End If End With Loop Done: ' clean up ... Print "Disconnecting from Excel..." xlWorkbook.Close False ' close the Excel file without saving (we made no changes) Excel.Quit ' close Excel Set Excel = Nothing ' free the memory that we'd used Print "Finished Import." ' print finished msg End Sub