Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

put value in input box web page

2009luca

Programmer
Jul 27, 2013
228
IT
Based the site:


how to put 6 in input box (combinations) to the default have 5

I just use IE Object

My test code dont work!

Sub InserisciValoreInPaginaWeb()

Dim IE As Object
Dim HTMLDoc As Object
Dim HTMLInput As Object
Dim URL As String
Dim ValoreDaInserire As String

' Imposta l'URL della pagina web
URL = "https://risultatilotto.com/superenalotto/generatore-numeri/" ' Sostituisci con l'URL della tua pagina

' Imposta il valore da inserire
ValoreDaInserire = "Hello World"

' Crea un'istanza di InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")

' Nascondi la finestra del browser (opzionale)
IE.Visible = False

' Naviga alla pagina web
With IE
.navigate URL
Do While .readyState <> 4 ' Aspetta che la pagina sia caricata
DoEvents
Loop

' Imposta il valore nell'input text
Set HTMLDoc = .document
Set HTMLInput = HTMLDoc.getElementById("combinations675") ' Sostituisci "myInput" con l'ID del tuo input

If Not HTMLInput Is Nothing Then
HTMLInput.Value = ValoreDaInserire
Else
MsgBox "Elemento HTML con ID 'myInput' non trovato."
End If

End With

' Chiudi il browser (opzionale)
IE.Quit
Set IE = Nothing

End Sub
 
Last edited:

Part and Inventory Search

Sponsor

Back
Top