Sammlung = .OLEObject~new("Excel.Application") Sammlung~visible = .true -- make Excel visible Worksheet = Sammlung~Workbooks~Add~Worksheets[1] colTitles = "AB" -- define first 2 column letters lastLine = 4 -- number of lines to process do line = 1 to lastLine -- iterate over lines do col = 1 to colTitles~length -- iterate over columns colLetter = colTitles[col] -- get column letter cell = Worksheet~Range(colLetter||line) -- e.g. ~Range("A1") if line = 1, col = 1 then do -- first row? yes, build title cell~value = "Beispielsammlung" -- header in first row cell~font~bold = .true -- make font bold cell~Interior~ColorIndex = 20 -- light blue end else if line = 1, col = 2 then do cell~value = "Werte" -- header in first row cell~font~bold = .true -- make font bold cell~Interior~ColorIndex = 24 -- light purple end else if line = 2, col = 2 then do Datenquelle1 = .OLEObject~new("Excel.Application") Datenquelle1~visible = .true OpenIt=Datenquelle1~Workbooks~Open("C:\Users\eritters\Documents\Projekt\Datei1.xlsx") Cell_Value1 = Datenquelle1~cells(2,1)~value Say "value" Cell_Value1 cell~value = cell_Value1 Datenquelle1~quit end else if line = 3, col = 2 then do Datenquelle2 = .OLEObject~new("Excel.Application") Datenquelle2~visible = .true OpenIt=Datenquelle2~Workbooks~Open("C:\Users\eritters\Documents\Projekt\Datei2.xlsx") Cell_Value2 = Datenquelle2~cells(2,1)~value Say "value" Cell_Value2 cell~value = cell_Value2 Datenquelle2~quit end else if line = lastline, col = 1 then do cell~value = "Summe" cell~font~bold = .true -- make font bold cell~Interior~ColorIndex = 44 -- yellow end else if line = 4, col = 2 then do summe = Worksheet~range("B4") summe~font~bold =.true summe~Interior~ColorIndex = 44 summe~formula = "=sum(B2:B3)" end else do command = "dir /b" quote("C:\Users\eritters\Documents\Projekt\*.xlsx") say "command :" command Excelwerte = .array~new address system command with output using (Excelwerte) do i=1 to Excelwerte~items cell~value = Excelwerte end end end end Worksheet~Columns("A:B")~EntireColumn~AutoFit Worksheet~SaveAs("C:\Users\eritters\Documents\Projekt\BPProjektG03.xlsx") Sammlung~Quit ::routine quote -- Zeichenkette in doppelte Anf��hrungszeichen return '"' || arg(1) || '"'