• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1057
  • Last Modified:

How to copy paste Excel data to an Internet form

I wrote an excel macro which extracts payment data from the screen onto an excel worksheet.  

I want to copy paste the excel data onto an internet payment form.

If I copy data from several excel cells, and try and paste the data onto the internet payment form, all the data from the several excel cells gets pasted onto the first field on the internet form.  It does not tab down to the next input field on the internet form and paste the data from the next excel cell that is in the clipboard.

I set up a partial fix.  I set up a button on the excel worksheet which copies the current cell and goes down to the next cell.  Therefore, I can click on the excel button and paste to the corresponding field on the internet form.  It is not as fast as copying several cells in excel and pasting them in mass to all the fields on the internet form.

I am surprised that Microsoft doesn't have this copy/paste option.  Maybe they do, I just haven't come across it.

If there isn't a standard fix for this, is it possible to insert the Tab Function into the excel worksheet, so that it executes when you paste to the internet form?

  • 2
1 Solution
[ fanpages ]IT Services ConsultantCommented:
Hi Charlie65,

Is the "Internet payment form" shown upon a web page loaded in Internet Explorer (or another web browser)?

The way in which clipboard data is processed will be something that the destination application (the web browser) will handle (in conjunction with standard MS-Windows clipboard functionality).  If it is not expecting multiple fields of data, then it will simply paste all of the clipboard data into the active form field when the paste request is made.

What we could look at, however, is opening the "Internet payment form" via MS-Excel & copying the predefined cells to the form with a single request (via a button, for example), within the workbook.

Changing the way in which the web browser handles data pasted from the clipboard may well not be possible at all.


Charlie65Author Commented:
Sounds Great!!

How do I open the "Internet payment form" via MS-Excel?

[ fanpages ]IT Services ConsultantCommented:
As I do not know which "Internet payment form" you are using, I have just opened "http://yahoo.com" & pasted the contents of cells [A1] and [B1] into the "Search" criteria text field:

Option Explicit
Public Sub Yahoo()

  Dim objCollection                                     As Object
  Dim objInternetExplorer_Application                   As Object
  Set objInternetExplorer_Application = CreateObject("InternetExplorer.Application")
  objInternetExplorer_Application.Visible = True
  objInternetExplorer_Application.Navigate "http://yahoo.com"
  While (objInternetExplorer_Application.ReadyState <> 4) Or (objInternetExplorer_Application.Busy)
  Set objCollection = objInternetExplorer_Application.document.getElementsByTagName("input")
  objCollection(0&).Value = [A1] & " " & [B1]
  Set objCollection = Nothing
  Set objInternetExplorer_Application = Nothing
End Sub

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now