Subject: Any tips where to start learning writing script to export to excel
Dim s As New notessessionDim db As NotesDatabase
Dim vw As NotesView
dim doc as NotesDocument
Dim xlApp As Variant, xlsheet As Variant
Dim rw As Integer, cl As Integer
dim vr as variant
Set db = s.CurrentDatabase
set vw = db.GetView(“Your View”)
set doc = vw.GetFirstDocument
Set xlApp = CreateObject(“Excel.application”)
If xlApp Is Nothing Then
Msgbox "Error!!! Agent was unable to open Microsoft Excel."
Exit Sub
End If
xlApp.Visible = True
xlApp.Workbooks.Add
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)
xlsheet.Select
rw = 1
cl = 1
xlsheet.Cells(rw, cl).value = “Excel Column Label1”
xlsheet.Cells(rw, cl+1).value = “Excel Column Label2”
xlsheet.Cells(rw, cl+2).value = “Excel Column Label3”
rw= rw+2
’ If you put it in a loop, these rw & cl will be helpful for incrementing anf filling up the column.
vr = doc.ColumnValues(0) -------> 1st view column value
xlsheet.Cells(rw, cl).value = vr
vr = doc.ColumnValues(1) -----------> 2nd view column value
xlsheet.Cells(rw, cl+1).value = vr
vr = doc.ColumnValues(2) -----------> 3rd view column value
xlsheet.Cells(rw, cl+2).value = vr
Hope this helps.