VBA to Enter Data Online and Submit Form

后端 未结 1 841
眼角桃花
眼角桃花 2020-12-03 18:48

I\'m trying to use VBA to submit data from Excel to a webform online. The issue happens within the * area where I\'m trying to select and update the form. I

相关标签:
1条回答
  • 2020-12-03 19:05

    Try below code

    Dim IE As Object
    
    Sub submitFeedback3()
        Application.ScreenUpdating = False
    
        Set IE = CreateObject("InternetExplorer.Application")
        IE.Visible = True
        IE.Navigate "http://spreadsheetbootcamp.com/excel-efficiency-trainer-feedback/"
    
        Application.StatusBar = "Submitting"
        ' Wait while IE loading...
        While IE.Busy
            DoEvents
        Wend
        ' **********************************************************************
        delay 5
        IE.Document.getElementById("experience-1372700847").Value = "ffffffffd1"
        delay 5
        IE.Document.getElementById("Form_Time_Best-1372700847").Value = "ffffdffffdffffffffd2"
        delay 5
        IE.Document.getElementById("submit-1-1372700847").Click
        '**********************************************************************
        Application.StatusBar = "Form Submitted"
        IE.Quit
        Set IE = Nothing
    
        Application.ScreenUpdating = True
    End Sub
    
    Private Sub delay(seconds As Long)
        Dim endTime As Date
        endTime = DateAdd("s", seconds, Now())
        Do While Now() < endTime
            DoEvents
        Loop
    End Sub
    
    0 讨论(0)
提交回复
热议问题