小编dea*_*TDK的帖子

通过VBA获取现有IE

我的目标是将同一网站上多个网页上的数据抓取到Excel中。我在IE8的标签页中打开了这些页面。我没有打开其他IE窗口。

我已经尝试了以下方法来打开IE:

AppActivate "Microsoft Internet Explorer provided by [my company]"
' It loses focus, the titlebar flashes for a fraction of a second 
' .. another code ..
Dim ShellApp
Set ShellApp = CreateObject("Shell.Application")
Dim ShellWindows
Set ShellWindows = ShellApp.Windows()
Dim i
For i = 0 To ShellWindows.Count - 1
    If InStr(ShellWindows.Item(i).FullName, "iexplore.exe") <> 0 Then
        Set IEObject = ShellWindows.Item(i) 
    End If
Next
' Did absolutely nothing, grabbed this code from another solution on stackoverflow
Run Code Online (Sandbox Code Playgroud)

我还尝试了GetObject(我不想使用CreateObject方法),如下所示

dim ie As InternetExplorer …
Run Code Online (Sandbox Code Playgroud)

excel internet-explorer vba

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

excel ×1

internet-explorer ×1

vba ×1