Bis jetzt kann ich nur Werte in Excel reinschreiben, siehe Code:
Code: Alles auswählen
[code]import win32com
import win32com.client
from win32com.client import Dispatch
xlApp = Dispatch("Excel.Application")
xlApp.Workbooks.Open("D:\qwertz.xls")
xlApp.Visible = 1
contents = ('Fin/GHz', 'Fout/GHz', 'Pin/dBm', 'Pout/dBm')
for i, content in enumerate (contents):
xlApp.ActiveSheet.Cells(1, i+1).Value = content
Fin = [0,0,0]
Fout =[8,9,10]
Pin = [1.0, 2.5,3.4]
Pout =[25.5, 30, 7]
j = 0
n = 2
while j < 3:
liste = ([Fin[j], Fout[j], Pin[j], Pout[j]])
for m, content in enumerate (liste):
xlApp.ActiveSheet.Cells(n, m+1).Value = content
n += 1
j += 1
ws = xlApp.Worksheets('Tabelle1')
ws.Makro1()
bei den letzten zwei Codezeilen bin ich schon am rumprobieren. Jemand eine Ahnung ?