在访问Intranet站点后尝试关闭IE时出现VBA错误 [英] VBA error when trying to close IE after accessing intranet site

查看:60
本文介绍了在访问Intranet站点后尝试关闭IE时出现VBA错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果使用Internet网站(例如google),则以下代码可以正常工作.但是,我需要访问一个工作Intranet网站.当我得到以下错误时,运行时错误为"-2147023179(800706b5)":自动化错误接口未知.

The code below works fine if a internet site such as google is used. However, I need to access a work intranet site. When I do I get the following error, run-time error '-2147023179 (800706b5)': Automation error The interface is unknown.

Dim ie As Object

Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate "INTRANET SITE"

Do While ie.Busy
    DoEvents
Loop

ie.Quit
Set ie = Nothing

请帮助.谢谢.

注意:如果以管理员身份运行excel,则可以正常工作;但是,我认为仅此一本工作簿就不可能以excel的身份运行excel.

NOTE: If excel is ran as administrator then this works fine; however, I don't think its possible for excel to be ran as admin for just this one workbook.

推荐答案

取消选中保护模式即可解决此问题.

Unchecking protected mode fixed the problem.

还可以使用以下代码

Set ie = New InternetExplorerMedium

这篇关于在访问Intranet站点后尝试关闭IE时出现VBA错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆