über ein Lotus Notes Script öffne ich eine Excel Arbeitsmappe, füge ein Sheet hinzu und befülle es mit Daten aus einem Notesdokument. Das funktioniert prime.
Die weitere Verarbeitung der Daten soll nun ein Excelmakro übernehmen. Dieses Makro will ich vom Lotus Notes Script aus starten.
Das soll der letzte Befehl in diesem Script sein. Es gibt aber eine Notes Fehlermeldung, dass die Instanz Run nicht existiert.
Sub Initialize
Dim s As New notessession
Dim ws As New notesuiworkspace
Dim uiv As notesuiview
Set uiv = ws.currentview
Dim db As notesdatabase
Set db = s.currentdatabase
Dim Doc As notesdocument
Dim coll As notesdocumentcollection
Set coll = db.unprocesseddocuments
Print "Connecting to Excel..."
Set Excel = CreateObject("Excel.Application")
Excel.visible = True
Excel.Workbooks.Open ("H:\Eigene Dateien\ExcelDatei.xlsm")
Excel.ActiveWorkbook.WorkSheets.Add
Set xlWorkbook = Excel.ActiveWorkbook
Set xlSheet = xlWorkbook.ActiveSheet
xlsheet.Name = "Datenexport"
Dim counter As Integer
Dim row As Integer
row = 1
Set doc = coll.getfirstdocument
While Not (doc Is Nothing)
xlSheet.cells(row,1).value = doc.Firma(0)
xlSheet.cells(row,2).value = doc.DocID(0)
xlSheet.cells(row,3).value = doc.PTN_Firma(0)
xlSheet.cells(row,4).value = doc.ProductRange(0)
xlSheet.cells(row,5).value = doc.ModSelecList(0) & ";" & doc.Mod3PSelecList(0)
Set doc = coll.getnextdocument(doc)
row = row +1
Wend
Excel.Rows("1:" & row).select
Excel.selection.columns.Autofit
xlSheet.cells(1,1).select
Excel.ActiveWorkbook.Run ("Auswahlhilfe")
End Sub