建议你用VBS,代码论坛里很多,自己搜索。
另外WInCC信息系统中的VBS章节也提供了访问Excel的示例代码:
quote:Example 1: MS Excel
In this example, an output value from an input field is written in an Excel table.
'VBS113
Dim objExcelApp
Set objExcelApp = CreateObject("Excel.Application")
objExcelApp.Visible = True
'
'ExcelExample.xls is to create before executing this procedure.
'Replace
with the real path of the file ExcelExample.xls.
objExcelApp.Workbooks.Open "\ExcelExample.xls"
objExcelApp.Cells(4, 3).Value = ScreenItems("IOField1").OutputValue
objExcelApp.ActiveWorkbook.Save
objExcelApp.Workbooks.Close
objExcelApp.Quit
Set objExcelApp = Nothing