good afternoon!
I'm trying to run a Macro that opens a website, login, select an option in the menu, fill a text-box and click another button.
So far, I can open the website, login, select the option in the menu, but I can't get the text-box filled by any means. That text box has a text mask:
Format: 00000-000 Type: Numeric Max Char.: 8 Min Char.: 8
Sub SAVE()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.StatusBar = "Searching"
Sheets("WEB").Visible = True
Dim IE As New InternetExplorer
Dim WshShell As Object
Dim dtInicio As Date
Dim objIE As New DataObject
Sheets("SAVE").Select
Sheets("SAVE").Cells.Clear
S = 2
V = 2
SALVA = 0
Do While Sheets("Adress").Cells(V, 2) <> ""
IE.Visible = True
Sheets("WEB").Select
ActiveWindow.SelectedSheets.Delete
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Select
Sheets(Sheets.Count).Name = "WEB"
'OPEN URL
IE.navigate "URL HERE"
While IE.Busy Or IE.readyState <> READYSTATE_COMPLETE
Sleep (1000)
DoEvents
Wend
IE.Document.forms(0).pUsrLg.Value = "user"
IE.Document.forms(0).pUsrSn.Value = "password"
IE.Document.parentWindow.execScript "login();"
While IE.Busy Or IE.readyState <> READYSTATE_COMPLETE
Sleep (1000)
DoEvents
Wend
IE.Document.parentWindow.execScript "enviaPage('mod_pesquisa/DisponibilidadeNaoClientes.asp', 'GET', 'True', 'dv_pagina', 'pUsrId=0000050007', 'True', 389, 892);"
While IE.Busy Or IE.readyState <> READYSTATE_COMPLETE
Sleep (1000)
DoEvents
Wend
The Input I must fill looks like this:
<input name="pCepNr" id="pCepNr" type="text" class="st_cxt_01" style="height: 20px; width: 85px; background-color: #FFEEDD; color: #913A1A;">