Jump to content
Fórum Script Brasil
  • 0

Question

boa tarde!

estou tentando criar uma macro que entre em um site insira alguns parâmetros e me  retorne o resultado na planilha e isso sera feito automático a casa 5 min. porem comecei com a parte em que a planilha acesse o site e insira os dados porem quando faco o teste com o "F8"  ele apresenta um erro no primeiro parâmetro a ser inserido.

poderiam me ajudar.

Sub monitoramento()

Set ie = CreateObject("internetexplorer.application")

ie.navigate "http://sitedesejado/"
ie.Visible = True

Do While ie.busy And ie.readyState <> "READYSTATE_COMPLETE"
DoEvents
Loop

ie.document.getElementsByTagName("td")(0).Value = Cells(2, 2).Value( aqui aparece o erro de "91" agluma coisa haver com with)

ie.document.getElementsByTagName("td")(1).Value = Cells(2, 4).Value


ie.Quit

End Sub
 

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Tenta usar esse comando:

Sub GrabLastNames()

    'dimension (set aside memory for) our variables
    Dim objIE As InternetExplorer
    Dim ele As Object
    Dim y As Integer
    
    'start a new browser instance
    Set objIE = New InternetExplorer
    'make browser visible
    objIE.Visible = True
    
    'navigate to page with needed data
    objIE.navigate "https://seu site"
    'wait for page to load
    Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
    
    'we will output data to excel, starting on row 1
    y = 1
    
    'look at all the 'tr' elements in the 'table' with id 'myTable',
    'and evaluate each, one at a time, using 'ele' variable
    For Each ele In objIE.document.getElementsByTagName("title")
        'show the text content of 'tr' element being looked at
        Debug.Print ele.textContent
    'repeat until last ele has been evaluated
    Next

    'save the Excel workbook
    'ActiveWorkbook.Save

End Sub

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Cloud Computing


  • Forum Statistics

    • Total Topics
      148691
    • Total Posts
      644524
×
×
  • Create New...