VBScript错误800A01B6 document.parentwindow.screen.availwidth

VBScript错误800A01B6 document.parentwindow.screen.availwidth,vbscript,runtime-error,Vbscript,Runtime Error,我有一个脚本,多年来一直运作良好。上周,我们更改了用户帐户,它突然停止工作,并开始返回VBScript错误800A01B6 document.parentwindow.screen.availwidth。如果我们使用以前的帐户登录并执行脚本,它将一如既往地完美运行。但是,它不会与新帐户一起运行。新用户帐户也与旧帐户位于同一管理员组中。我弄不清这两次处决的区别 请帮忙 下面是代码示例: Dim oIEPW, sPWHTML, ctr Dim objWMIService, colItems, obj

我有一个脚本,多年来一直运作良好。上周,我们更改了用户帐户,它突然停止工作,并开始返回VBScript错误800A01B6 document.parentwindow.screen.availwidth。如果我们使用以前的帐户登录并执行脚本,它将一如既往地完美运行。但是,它不会与新帐户一起运行。新用户帐户也与旧帐户位于同一管理员组中。我弄不清这两次处决的区别

请帮忙

下面是代码示例:

Dim oIEPW, sPWHTML, ctr
Dim objWMIService, colItems, objItem, ScreenWidth, ScreenHeight, Scr
'Get HTML and place it in a variable
Call WriteHTML(sPWHTML)
'Create Internet Explorer object
'Set oIEPW = WScript.CreateObject("InternetExplorer.Application", "IE_")
Set oIEPW = WScript.CreateObject("InternetExplorer.Application", "IE_")
'Set window properties
With oIEPW
    .Navigate "about:blank" 'Use blank page as base
    Do While .ReadyState <> 4 'Wait for IE process to start
        WScript.Sleep 50
    Loop
    .Document.Open 'Create document that will be in IE window
    .Document.Write (sPWHTML) 'Paste in HTML
    .Document.Close 'Complete the page creation
    .Resizable = 0
    .ToolBar = 0 'Disable IE's tool bars
    .StatusBar = 0 'Disable IE's status bar
    .Width = 294 'Set window width in pixels
    .Height = 155 'Set window height in pixels
    ScreenWidth = .Document.ParentWindow.Screen.AvailWidth 'Find screen width in pixels
    .Left = (ScreenWidth / 2) - (.Width / 2) 'Distance in pixels of window left edge to left side of screen
    ScreenHeight = .Document.ParentWindow.Screen.AvailHeight 'Find screen height in pixels
    .Top = (ScreenHeight /2) - (.Height / 2) 'Distance in pixels of window top edge to top of screen
    'WshShell.Popup "Width: " & ScreenWidth & VbCrLf & "Height: " & ScreenHeight,,"Screen Resolution",4096
    Do While .ReadyState <> 4 'Wait for all properties to be set
        WScript.Sleep 50
    Loop
    .Visible = 1 'Make IE window visible
End With
'Bring IE window to the top
WshShell.AppActivate "Internet Explorer"
Dim oIEPW、sPWHTML、ctr
Dim objWMIService、COLITEM、objItem、屏幕宽度、屏幕高度、Scr
'获取HTML并将其放置在变量中
调用WriteHTML(sPWHTML)
'创建Internet Explorer对象
'Set oIEPW=WScript.CreateObject(“InternetExplorer.Application”,“IE”)
设置oIEPW=WScript.CreateObject(“InternetExplorer.Application”、“IE”)
'设置窗口属性
与oIEPW合作
.导航“关于:空白”使用空白页作为基础
执行While.ReadyState 4'等待IE进程启动
WScript.Sleep 50
环
.Document.Open“创建将在IE窗口中显示的文档
.Document.Write(sPWHTML)“粘贴到HTML中
.Document.Close“完成页面创建
.resizeable=0
.ToolBar=0'禁用IE的工具栏
.StatusBar=0'禁用IE的状态栏
.Width=294'以像素为单位设置窗口宽度
.Height=155'以像素为单位设置窗口高度
ScreenWidth=.Document.ParentWindow.Screen.AvailWidth'查找屏幕宽度(以像素为单位)
.Left=(屏幕宽度/2)-(.Width/2)窗口左边缘到屏幕左侧的像素距离
ScreenHeight=.Document.ParentWindow.Screen.AvailHeight'查找屏幕高度(以像素为单位)
.Top=(屏幕高度/2)-(.Height/2)窗口顶部边缘到屏幕顶部的像素距离
'WshShell.Popup“宽度:”&ScreenWidth&VbCrLf&“高度:”&ScreenHeight,,“屏幕分辨率”,4096
执行While.ReadyState 4'等待设置所有属性
WScript.Sleep 50
环
.Visible=1'使IE窗口可见
以
“把窗户顶上
WshShell.app激活“Internet Explorer”

有关代码的帮助:显示代码(或者更确切地说是代码的一部分)。显示完整的错误消息。解释您如何运行代码。我已按要求提交了示例代码供您参考。请尝试将代码更改为所有小写(
.document.parentwindow.screen.availwidth
)。见专家交流。