+ Reply to Thread
Results 1 to 6 of 6

Copying a cell into a website input text box

Hybrid View

  1. #1
    Registered User
    Join Date
    05-22-2009
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2003
    Posts
    47

    Uploading specific cell information to website

    Hi,

    I was wondering if anyone knows a way to get a specific cell loaded into a website automatically. (i.e. Cell A2 always goes into the input username box on the website, Cell A3 always goes into the input date section of the website).

    Thanks.

  2. #2
    Registered User
    Join Date
    05-22-2009
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2003
    Posts
    47

    Copying a cell into a website input text box

    Hi,

    Is there a way to create a macro that will automatically copy a cell and input it into a specific "input text" box in a website?

    Thanks.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Copying a cell into a website input text box

    Souljive, to all intents and purposes your 2nd post here is (was) a dupe thread and as such does not comply with Rule 5 of our forum rules.

    On this occasion I have merged the threads as the narratives are slightly different and each give important bits of info.. going forward do not post duplicate threads.

  4. #4
    Registered User
    Join Date
    05-22-2009
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Copying a cell into a website input text box

    Hi,

    I tried scouring the web and came up with this code to input a login name and a password into a website:

    Sub OpenWebpageAndLogin()
        Dim objIE As Object
        On Error GoTo error_handler
        Set objIE = CreateObject("InternetExplorer.Application")
            With objIE
                .Navigate "https://SampleWebsite.com"
                Do While .Busy: DoEvents: Loop
                Do While .ReadyState <> 4: DoEvents: Loop
                .Visible = True
                With .Document.forms("InputFormA")
                    .loginname.Value = "My Username"
                    .Password.Value = "My Password"
                    .Submit
                End With
            End With
        Set objIE = Nothing
        Exit Sub
    error_handler:
        MsgBox ("Unexpected Error, I'm quitting.")
        objIE.Quit
        Set objIE = Nothing
    End Sub
    What I am trying to do is have the code look into the HTML of the site, find the UserId and Password fields and fill them in. I think I am really close, but the example I saw on the internet is when the intput text boxes were used as forms in HTML, not tables. Here is how my HTML looks:

    <tr>
            	<td colspan="2">
                      <input class="InputFormA" name="UserId" type="text" id="UserId" size="38" maxlength="48" value="username" style="background-color:#FFFFCC;">
                    </td>
                  </tr>
    
    		    <tr>
                          <td colspan="2" class="wdc-text-comments-bold">Password:</td>
                        </tr>
                        <tr>
                          <td colspan="2">
                            <input class="InputFormA" name="Password" type="password" id="Password" size="38" maxlength="48" style="background-color:#FFFFCC;">
                          </td>
                        </tr>
    Please let me know if you can help me rearrange the VBA code so that it puts in the username/password! I think I am very close.
    Last edited by souljive99; 10-02-2009 at 04:50 PM. Reason: codes impromperly bracketed

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Copying a cell into a website input text box

    souljive99,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Please edit your prior post accordingly further please take the time to read (and subsequently adhere to) the Forum Rules before posting further.

  6. #6
    Registered User
    Join Date
    05-22-2009
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Copying a cell into a website input text box

    sorry about that, I put <> instead of brackets.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1