发表于:2007-04-14 19:17:00
4楼
呵呵,西门子Wincc帮助中有一个例子是将输入输出域的东西直接输出到Execl,下面给出帮助中的代码。
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 <path> with the real path of the file ExcelExample.xls.
objExcelApp.Workbooks.Open "<path>\ExcelExample.xls"
objExcelApp.Cells(4, 3).Value = ScreenItems("IOField1").OutputValue
objExcelApp.ActiveWorkbook.Save
objExcelApp.Workbooks.Close
objExcelApp.Quit
Set objExcelApp = Nothing