In diesem Beispiel wird eine Excel-Tabelle erstellt, die Überschriften gesetzt und von einem Notes-Dokument die Felder als Spalte in die Excel-Tabelle übertragen.
Dim xlApp As Variant
Dim xlSheet As Variant
Dim doc as notesdocument
set doc = "Hier wird das Notes-Dokument gesetzt!"
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Add
xlApp.ReferenceStyle = 2
xlApp.StatusBar = "Hier kommt deine Statusmeldung !"
Set xlSheet = xlApp.Workbooks(1).Worksheets(1)
' Titelzeile
xlSheet.Cells(1,1) = "Überschrift Spalte 1"
xlSheet.Cells(1,2) = "Überschrift Spalte 2"
xlSheet.Cells(1,3) = "Überschrift Spalte 3"
xlSheet.Cells(1,4) = "Überschrift Spalte 4"
' 2. Zeile
xlSheet.Cells(2,1) = doc.GetItemValue("DeinFeld1")(0)
xlSheet.Cells(2,2) = doc.GetItemValue("DeinFeld2")(0)
xlSheet.Cells(2,3) = doc.GetItemValue("DeinFeld3")(0)
xlSheet.Cells(2,4) = doc.GetItemValue("DeinFeld4")(0)
xlApp.StatusBar = "Formatiere Zellen !"
xlApp.Range(xlSheet.Cells(4,1), xlSheet.Cells(row,15)).Select
xlApp.Selection.Columns.AutoFit
xlApp.Range("A1").Select
xlApp.StatusBar = "Fertig !"