How to import data from excel to notes in lotus script.
Pls guide me
amar
How to import data from excel to notes in lotus script.
Pls guide me
amar
Subject: import data from excel to notes
Hi, Save the Excel sheet as wk4 format.
make the view with the same title as in the Wk4 format data sheet ok.Then from file menu chosse the imprt option.The data will come to View.
regards,
Rekha
Subject: RE: import data from excel to notes
Hi Thanks,Rekha i know this way but i want to know how it works through lotus script
Thanks
amar
Subject: RE: import data from excel to notes
Hi!
I use this code:
Sub Initialize
Dim xlFilename As String
xlFilename = "c:\file.xls" '// name of the file
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 Excel As Variant
Dim xlWorkbook As Variant
Dim xlSheet As Variant
Print "Connecting to Excel..."
Set Excel = CreateObject( "Excel.Application.10" )
Excel.Visible = False
Print "Opening " & xlFilename & "..."
Excel.Workbooks.Open xlFilename
Set xlWorkbook = Excel.ActiveWorkbook
Set xlSheet = xlWorkbook.ActiveSheet
Goto Records
Print "Disconnecting from Excel..."
xlWorkbook.Close False
Excel.Quit
Set Excel = Nothing
Print " "
Records:
row = 0
written = 0
Print " importing..."
Do While True
Finish:
With xlSheet
row = row + 1
Set view = db.GetView("Main View")
Set doc = db.CreateDocument
doc.Form = "kurs" '// name of the form
doc.kurs_namn = .Cells( row, 1 ).Value'// name of the fields
doc.kurs_persnr = .Cells( row, 2 ).Value'// etc
doc.kurs_anmkod = .Cells( row, 3 ).Value
Call doc.Save( True, True ) '// save
written = written + 1
If written = 1215 Then '// ask if to continue after this number
Print written
Print written & "record stopped at..", doc.SWEPO(0), doc.SWEORDER(0),doc.SWEORDERDATE(0),doc.ITEMNUMBER(0)
ans$ = Inputbox$("Continue the import, Y/N?")
If ans$ = "Y" Or ans$ ="y" Then
Goto Finish
Else
Goto Done
End If
End If
’ End If
End With
Loop
Return
Done:
End Sub
Subject: RE: import data from excel to notes
Whenever I attempt to use the above code I get the following error…“cannot create automation object”.
Is there something that I am missing?
Subject: Integra
I use our own product: Integra for Notes.
I’m a sales-guy, so I don’t really know the details on how to program stuff, but our tool makes it easy for me.
I set up an import profile, where I select the database and the fields I want to get data in. Than I determin where my excel sheet is, and i’m done! Ready to run, without putting any code anywhere!
www.integra4notes.com for a free trail version
Subject: import data from excel to notes
come here i will show u…how 2 do it properly…