Mobile app version of vmapp.org
Login or Join
Vandalay111

: How to allow Excel data to be pasted into website text boxes? I have to enter some details (pertaining to a vehicle) into an online portal (filling many text boxes; i.e., form fields) many

@Vandalay111

Posted in: #WebsiteFeatures

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Vandalay111

1 Comments

Sorted by latest first Latest Oldest Best

 

@Shelley277

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:

vbadud.blogspot.in/2009/08/how-to-login-to-website-using-vba.html social.msdn.microsoft.com/Forums/en-US/a5258cde-ce38-4638-863e-793b1e60b94d/excel-macro-to-autofill-data-in-website?forum=exceldev answers.microsoft.com/en-us/office/forum/office_2003-customize/fill-out-web-form-from-excel/0f1240e4-94c5-4af9-bc4e-bc840133bcbe answers.microsoft.com/en-us/office/forum/office_2007-customize/using-vba-to-enter-data-into-an-html-form/41eb57b0-244b-4f61-80be-fb17033813d6

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme