发布于 2008-07-11 10:28:06
0楼
Sub StartX0000005FGD1_OnClick(Byval Item)
Dim oWord,oApp,oDoc
' oApp, oTbl, oDoc
' Open Word document and get first table
Set oWord = CreateObject("WORD.Application")
oWord.Visible = vbTrue
Set oDoc = oWord.Documents.Open(HMIRuntime.Tags("ProjectPath").Read & "MyWord.doc")
Set oApp = GetObject("WORD.Application")
oApp.Visible = vbTrue
End Sub
文件路径:C:\Program Files\Siemens\WinCC\WinCCProjects\xg\XuanHua-WinCC-Windows\MyWord.doc
Read格式
1、("MyWord.doc")
2、("\MyWord.doc")
Sub StartX0000005FGD1_OnClick(Byval Item)
Dim g_excelfilename
Dim excel
'Const g_excelfilename = "C:\Program Files\Siemens\WinCC\WinCCProjects\WinCC V6.0 Demo Application\DemoV6\Excel1.xls"
g_excelfilename = HMIRuntime.Tags("ProjectPath").Read & "\Excel1.xls"
MsgBox g_excelfilename
Set excel = CreateObject("Excel.Application")
excel.Visible = True
End Sub
Read格式
1、("Excel1.xls")
2、("\Excel1.xls")
还有这个EXCEL打开时间一闪而过 是因为什么阿?
Email:zhishiwangjian1@163.com
请注重指导一下这个程序什么地方不合理阿。别光让我找别的!
发现错误,改正错误是关键!!!!
只有退潮时,才知道谁在裸泳!
一日三省吾身,一天三遍论坛!
http://bbs.shejis.com/?fromuser=wamxh521
电气自动化论坛!