|
在qpt学习的课程中,我参考老师的例子,放到自己的本机上运行,报错,提示:
ActiveX 部件不能创建对象: 'Scripting.FileSyetemObject'
Line (17): "Set Fso = CreateObject("Scripting.FileSyetemObject")".
但是我又看不出问题在哪里,老师的例子中也是那样写的。
请问这段代码的问题究竟在什么地方??
Dim Fso,TheFile,ReadString
Dim iPos,iLen
Dim TestNumerOne,TestNumerTwo
Const ForReading=1
Set Fso = CreateObject("Scripting.FileSyetemObject")
Set TheFile=Fso.OpenTextFile("E:\测试\代码练习\计算器加法用例.txt",ForReading,false)
do while TheFile.AtEndOfLine <> true
ReadString=TheFile.ReadLine
iPos=instr(1,ReadString,",",1)
iLen=Len(ReadString)
TestNumerOne=Left(ReadString.iPos-1)
TestNumerTwo=Right(TeadString.iLen-iPos)
'点击按钮1
Window("计算器_2").WinButton(TestNumerOne).Click
Window("计算器_2").WinButton("+").Click
Window("计算器_2").WinButton(TestNumerTwo).Click
Window("计算器_2").WinButton("=").Click
Window("计算器_2").Close
Loop
TheFile.Close
Set TheFile=Nothing
Set Fso=Nothing |
|