VBA Internet Explorer Automation 'Permission Denied'

后端 未结 8 1329
别那么骄傲
别那么骄傲 2020-12-19 23:11
Dim IE as New InternetExplorer
IE.Visible = True

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

Do Until IE.Busy = False
Loop

IE.document.getElementsByTagName(\"Input\")(         


        
8条回答
  •  感动是毒
    2020-12-19 23:55

    I am receiving the same error when automating IE, but instead of fixing, I worked around.

      Label1:
             If myIe Is Nothing Then
                 Set myIe = CreateObject("InternetExplorer.Application") 
             End If
    
             myIe.Navigate URL:=imdbLink
    
        For Each link In myIe.document.Links
             If Right(link.href, 9) = "/keywords" And Left(link.href, 26) = "http://www.imdb.com/title/" Then
                        mKPlot = link.href 'ERROR GENERATES FROM THIS, SOMETIMES...
             End If
        next link
    
    
    
    errHandler:
        If Err.Number = 70 Then
            Debug.Print "permission denied for: |" & title & "|"
    
            myIe.Quit
            Set myIe = Nothing
    
            Application.Wait Now + TimeValue("00:00:10")
    
            Resume Label1:
    
        End If
    

    Not the sleek registry-fix you were imagining, but it works for me.

提交回复
热议问题