Selecionar guias da internet

magushi

26-09-2014 15:14:30

Prezados, boa tarde!

Preciso acessar algumas guias da web já abertas, aquelas que ficam juntas e não em um novo ie.
Podem me informar qual comando uso para navegar por estas guias?

Atenciosamente,

Magushi

webmaster

27-09-2014 02:42:56

magushi,

É você que abre o IE ou quer pegar o já aberto?

Abraços

webmaster

27-09-2014 03:44:30

magushi,

Se for o caso de abrir o IE pelo VBA, veja se isso ajuda:

http://blogs.msdn.com/b/rahulso/archive ... -ie-7.aspx

Abraços

magushi

29-09-2014 15:43:04

Tomás, bom dia!

Preciso selecionar o já aberto para manupila-lo.
Por exemplo fechar uma guia da que forem abertas.

Abraço.

webmaster

29-09-2014 17:23:18

magushi,

Fuçando por aí, cheguei no seguinte código, que abre uma nova aba na instância já aberta do Internet Explorer:

Código: Selecionar todos

Public Sub GetCurrentIEInstanceAndOpenANewTab()
    Dim objWindow As Object
    Dim objIEApp As Object
    Dim objShell As Object
    Dim objItem As Object
    On Error GoTo Fin
    Set objShell = CreateObject("Shell.Application")
    Set objWindow = objShell.Windows()
    For Each objItem In objWindow
        If LCase(objItem.FullName) Like "*iexplore*" Then
            Set objIEApp = objItem
        End If
    Next objItem
    If objIEApp Is Nothing Then
        Set objIEApp = CreateObject("InternetExplorer.Application")
        objIEApp.Visible = True
    End If
    With objIEApp
        .Visible = True
        .Navigate2 "http://www.google.com", 2048
        While Not .ReadyState = 4
            DoEvents
        Wend
        .Document.all.q.Value = "Excel VBA"
        .Document.Forms(0).submit
    End With
Fin:
    If Err.Number <> 0 Then MsgBox "Error: " & _
        Err.Number & " " & Err.Description
    Set objWindow = Nothing
    Set objShell = Nothing
End Sub
Veja se ajuda.

webmaster

29-09-2014 17:25:57