Excel 2007 VBA访问Internet Explorer 7对象 [英] Excel 2007 VBA accessing Internet Explorer 7 object

查看:81
本文介绍了Excel 2007 VBA访问Internet Explorer 7对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是第一次,但我已经在Excel中编写VBA应用多年了。

我有几个Excel项目可以创建一个IE对象,导航到一个url,抓取网页正文并进行一些处理。特别是,一个应用程序进入我使用的网站并获取所有知识库文章的副本。

I've got several Excel projects that create an IE object, navigate to a url, grab the web page body, and do some processing. In particular, one app goes to a site I use and gets copies of all their KB articles.

我们只是实现Vista,Office 2007和IE 7.现在,当我使用此代码时,ie.navigate方法会导致IE打开一个新窗口,后续代码会失败,因为没有新窗口的句柄。

We just implemented Vista, Office 2007, and IE 7. Now when I use this code, the ie.navigate method causes IE to open a new window, and the subsequent code fails because there is no handle to the new window.

这是我的代码:



代码块

推荐答案

您是否尝试过使用TargetFrameName参数强制导航使用您选择的窗口?请参阅:

Have you tried using the TargetFrameName parameter to force Navigate to use your choice of window? See: 

http://msdn2.microsoft.com/en-us/library/aa752093.aspx


这篇关于Excel 2007 VBA访问Internet Explorer 7对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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