对象不支持此属性或方法:"WshShell.CreateObject"
Dim aa
aa = 11
Set oIE = WScript.CreateObject("InternetExplorer.Application","Event_")
With oIE
.MenuBar = 0 '不显示IE对象菜单栏
.StatusBar = 0 '不显示IE对象状态栏
.AddressBar = 0 '不显示IE对象地址栏
.ToolBar = 0 '不显示IE对象工具栏
.Height = 150 '设置IE对象高度
'.FullScreen=0 '全屏化IE对象
.Width = 281 '设置IE对象宽度
.Navigate "about:blank" '设置IE对象默认指向的页面
.Visible = 1 '设置是否可见
.Resizable = 0 '设置IE对象大小是否可以被改动
.Document.Write "<HTML><title>修改管理</title><BODY scroll='no'>编号:<input id='input1' input1 value="&aa&"
.Document.Write "<center><input type=BUTTON name=certain value=确定>"
End With
'
Set oIE.Document.getElementById("certain").OnClick = GetRef("aaa")
Do
WScript.Sleep 200
Loop
Sub aaa
Dim str
str = oIE.Document.getElementById("input1").Value & VbCrLf
str = str & oIE.Document.getElementById("input2").Value & VbCrLf
str = str & oIE.Document.getElementById("input3").Value
WScript.Echo str
End Sub
Sub Event_OnQuit
WScript.Quit
End Sub
如上代码在VBSEdit中功能够正常运行,但是被其他方法调用时确报错:
报错信息为 缺少对象:'WScript'
修改为如下后,继续报错
Set WshShell = CreateObject("WScript.Shell")
Set oIE = WshShell.CreateObject("InternetExplorer.Application","Event_")
继续报错为:对象不支持此属性或方法:"WshShell.CreateObject"
麻烦大虾帮忙解决下,谢谢!