首页 > 解决方案 > 在 vba 中引用 iframe

问题描述

由于我之前的问题不再适合,我正在创建一个新问题。

我有以下代码来打开一个窗口。在那个窗口中,我想打开排序“功能”,然后选择要排序的属性。

  1. 翻页作品

什么不起作用,是试图解决排序下拉菜单的属性,以便它可以选择正确的。我总是进入debug.print length = 0最后一个代码行

编码:

Sub testalt()

Dim HTMLDoc As MSHTML.HTMLDocument
Dim ie As InternetExplorerMedium
Dim enumm As String
Dim ifrm As MSHTML.HTMLDocument
Dim selection As MSHTML.IHTMLElementCollection

enumm = "E2711846"

Set ie = New InternetExplorerMedium
ie.Visible = True
ie.navigate "https://plm.corp.int:10090/enovia/common/emxFullSearch.jsp?pageConfig=tvc:pageconfig//tvc/search/AutonomySearch.xml&tvcTable=true&showInitialResults=true&cancelLabel=Close&minRequiredChars=3&genericDelete=true&selection=multiple&txtTextSearch=" & [enumm] & "&targetLocation=popup"

Do While ie.readyState <> READYSTATE_COMPLETE
Loop


Set HTMLDoc = ie.document
Set ifrm = HTMLDoc.frames(1).document
Set selection = ifrm.getElementsByTagName("select")
Debug.Print selection.Length

End Sub

我认为这是打开页面的相关 html 部分。Sry 不知道如何复制它

这是 iframe,它在顶部

在此处输入图像描述

标签: htmlexcelvba

解决方案


推荐阅读