VBA Internet Explorer的自动化'权限被拒绝' [英] VBA Internet Explorer Automation 'Permission Denied'

查看:1570
本文介绍了VBA Internet Explorer的自动化'权限被拒绝'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dim IE as New InternetExplorer
IE.Visible = True

IE.Navigate("http://www.google.com")

Do Until IE.Busy = False
Loop

IE.document.getElementsByTagName("Input")(3).Value = "Search Term"

IE.document.Forms(0).Submit     <------ This line results in error.

该错误提示运行时错误70:'权限被拒绝

The error states Run-time error 70: 'Permission Denied'

请不要建议code改变。没有什么错与code。这个宏适用于9个10台计算机。这不是一个时机的问题(我仍然得到,即使我通过手动步骤的错误)。我知道还有其他方法来声明Internet Explorer对象。我一直在使用的CreateObject和所有的东西尝试。这一切都不重要。以管理员身份运行没有帮助的。

Please do not suggest code alterations. There is NOTHING wrong with the code. This macro works on 9 out of 10 computers. It is NOT a timing issue (I still get the error even if I step through manually). I know there are other ways to declare the internet explorer object. I have tried using CreateObject and all that stuff. None of it matters. Running as administrator does not help either.

这是问题的只是一个简单的例子(我们实际上是在自动化更复杂的任务)。所以,请不要问你为什么想要做一个goodle搜索?请不要问你有什么要做的。我需要这个问题解决了。我不需要做我的code重新编写的。

This is just a simple example of the problem (we are actually automating much more complex tasks). So please do not ask "why do you want to do a goodle search?" and please do not ask "what are you trying to do". I need this problem solved. I don't need my code re written.

我们使用的是Windows XP,Internet Explorer 7中,和Office 2003中有什么东西导致随机的人不能够自动IE浏览器。这不是一个用户的问题,而是一个计算机的问题。我的意思是罪魁祸首电脑没有人可以自动化无论在哪个用户登录,但同一用户可以使用不同的电脑,一切都很好。因此,它可能是一个注册表本地计算机或类似的东西上设置。所有的计算机都在这里设立了同样的方式,同样规格,同样的软件。

We use Windows XP, Internet Explorer 7, and Office 2003. Something is causing random people to not be able to automate internet explorer. It is not a user issue, but a computer issue. What I mean is on the culprit computers nobody can automate no matter which user logs in. But the same user can use a different computer and everything is fine. Therefore, it is likely a registry setting on the local machine or something like that. All computers are set up the same way here, same specs, same software.

我用Google搜索和Google搜索和Google搜索和Google搜索。不幸的是运行时错误70似乎是全部渔获物和大量的用户报告错误,为不同的症状。在我来说,我还没有找到一个解决办法,否则我就不会问在这里。

I have googled and googled and googled and googled. Unfortunately run-time error 70 seems to be a catch all and a lot of users report the error for different symptoms. In my case I have not found a solution otherwise I would not be asking here.

我们可以解决这个问题的唯一办法是把它完全重新装入硬盘驱动器上的所有内容。一个干净的更新,包括操作系统。这需要照顾的问题,但它也迫使用户重新设置他们的机器到他们以前的方式,并重新安装所有的软件和一切。这不是一个很好的解决方案。有机器造成这种或刷新不会产生效果上设置的某个地方。我想知道的设置是什么(我的感觉是这是一个注册表设置)。

The only way we can solve it is to have IT completely reload everything on the hard drive. A clean refresh including the operating system. That takes care of the problem but it also forces the user set their machine up again to the way they had it before and reinstall all of the software and everything. That is not a good solution. There is a setting somewhere on the machine causing this or the refresh would not have an effect. I want to know what that setting is (my feeling is it is a registry setting).

任何帮助是AP preciated,谢谢。

Any help is appreciated, thanks.

推荐答案

我有这个相同的问题。有自动化的IE浏览器已经工作一年罚款的脚本。接着出来的是蓝色的,我开始收到这个拒绝权限错误。我做了两件事,其中一个固定的问题,但我不知道是哪一个。

I was having this exact same problem. Had a script for automating IE that had been working fine for a year. Then out of the blue I started receiving this "permission denied error". I did two things, one of which fixed the problem, but I don't know which one.


  1. 我要去掉Microsoft Internet控制,试图编译该项目的参考,增加提及互联网控制放回,并编译了该项目。

  1. I removed the reference to "Microsoft Internet Controls", attempted to compile the project, added the reference to "Internet Controls" back in, and compiled the project.

宣布InternetExplorer对象,因为我并不需要从IE浏览器捕捉事件的事件时,无论如何删除了WithEvents就'关键字。

Removed the 'WithEvents' keyword when declaring the InternetExplorer object since I did not need to capture events events from IE anyway.

我怀疑这是第一个,不知怎的参考变得腐败和删除和重新添加它解决了这一问题。

I suspect it was the first and that somehow the reference became corrupted and removing at and re-adding it fixed the problem.

这篇关于VBA Internet Explorer的自动化'权限被拒绝'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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