1

I have to enter some details (pertaining to a vehicle) into an online portal (filling many text boxes; i.e., form fields) many times a day. I have the details that are to be entered into the portal in an Excel sheet. But the problem is that I need to enter the vehicle details into every text box one by one.

I rearranged the details in the Excel sheet to be in the order of text boxes in online portal and tried to paste them all at once, but all the text got pasted into the first tex tbox. How can I enter the details (values of a range of cells) all at once into these tex tboxes (fields in a form) with single copy_paste? If anyone has any other methods please suggest them.

1
  • I've used handsontable which emulates a spreadsheet in you website. It supports pasting data from Excel very well. The free open source version should meet your needs. Commented Jun 15, 2017 at 9:36

1 Answer 1

0

I have tried this one for myself but I think it will give you an idea, how to go in the right direction.

Here is a simple code that might help you out

The program requires references to the following:

1 Microsoft Internet Controls 2. Microsoft HTML Object Library

The Internet control is used to browse the webpage and the HTML Objects are used to identify the username and password textboxes and submit the text using the control button.

Create a Macro in VBA

Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Sub Login_2_Website()

Dim oHTML_Element As IHTMLElement
Dim sURL As String

On Error GoTo Err_Clear
sURL = "**Add your Website Url Where you want to fill the data**"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.navigate sURL
oBrowser.Visible = True

Do
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE

Set HTMLDoc = oBrowser.Document

HTMLDoc.all.Email.Value = "**EMAIL ADDRESS**"
HTMLDoc.all.passwd.Value = "*****"

For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next

' oBrowser.Refresh ' Refresh If Needed
Err_Clear:
If Err <> 0 Then
Debug.Assert Err = 0
Err.Clear
Resume Next
End If
End Sub

Reference Urls:

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.