VBA:“ htmlfile”应参考什么? [英] VBA: What to reference for "htmlfile"?

查看:733
本文介绍了VBA:“ htmlfile”应参考什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了行

Set xmlHttp = CreateObject("MSXML2.XMLHTTP")
Set html = CreateObject("htmlfile")

,并希望在我的代码中使用它们。只有我喜欢智能感知和显式选项,因此我迅速将第一个修改为

and want to use them in my code. Only I like intellisense and option explicit, so I quickly modified the first one to

'needs tools>references>microsoft xml, v5.0
Dim xmlHttp As MSXML2.xmlHttp: Set xmlHttp = New MSXML2.xmlHttp

我的问题是:第二行我该怎么做?我需要参考什么才能写

My question is: how do i do the same thing for the second line? What do I need to reference to be able to write

dim html as htmlfile

推荐答案

转到工具>参考>搜索 Microsoft HTML对象库>选中复选框>确定

Go to Tools > Reference > Search for Microsoft HTML Object Library > tick the checkbox > OK

现在您可以使用如下所示的早期绑定来定义html文档元素

Now you can define html document element using early binding like below

Dim html作为HTMLDocument

使用后期绑定,您可以在下面使用

Using late binding you can use below which creates html document element.

设置html = CreateObject( htmlfile)

这篇关于VBA:“ htmlfile”应参考什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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