VBA 关闭指定网页 出错
时间:2011-08-12
来源:互联网
从网页上搜到一段代码,运行时出错(红色部分处),不知何故:
Sub GetIEWindows()
Dim shellWd As ShellWindows
Dim iewd As InternetExplorer
Set shellWd = New ShellWindows
For Each iewd In shellWd
If TypeOf iewd.Document Is HTMLDocument Then
Debug.Print iewd.Document.URL
If iewd.Document.URL = "http://www.baidu.com/" Then
iewd.Quit
End If
End If
Next
Set iewd = Nothing
Set shellWd = Nothing
End Sub
虽已引用了 Microsoft Internet Controls 和 Microsoft HTML Object Libary,仍提示:
运行时错误 '-2147467259 (80004005)’:
自动化 (Automation) 错误
请高手指点 ,谢谢 !
Sub GetIEWindows()
Dim shellWd As ShellWindows
Dim iewd As InternetExplorer
Set shellWd = New ShellWindows
For Each iewd In shellWd
If TypeOf iewd.Document Is HTMLDocument Then
Debug.Print iewd.Document.URL
If iewd.Document.URL = "http://www.baidu.com/" Then
iewd.Quit
End If
End If
Next
Set iewd = Nothing
Set shellWd = Nothing
End Sub
虽已引用了 Microsoft Internet Controls 和 Microsoft HTML Object Libary,仍提示:
运行时错误 '-2147467259 (80004005)’:
自动化 (Automation) 错误
请高手指点 ,谢谢 !
作者: gfs57 发布时间: 2011-08-12
自己顶一下,请高手出招 !
作者: gfs57 发布时间: 2011-08-12
你是不是不是IE的浏览器?是遨游吧还是?
作者: xmyjk 发布时间: 2011-08-12
引用:
原帖由 xmyjk 于 2011-8-12 12:45 发表你是不是不是IE的浏览器?是遨游吧还是?
作者: gfs57 发布时间: 2011-08-12
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28