Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7618121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:19:07+00:00 2026-05-31T03:19:07+00:00

I have already created a Macro using a 3rd party application that does what

  • 0

I have already created a Macro using a 3rd party application that does what i want 80% of the time. The problem is that i can’t leave it running because it sometimes bugs out, or the browser takes a little longer to respond.

I would like to know if i could create what i wanted in the macro manager that comes with excel (VBA).

I want to:

  1. copy from A1, go to browser, paste in text box 1 (about half way down the page)
  2. Go back to excel, copy from B1, go to browser, paste in text box 2
  3. Click button in browser that says “Add”
  4. Wait for pop up box (javascript alert) to disapear
  5. Rinse and repeat X times, this time from A2 and B2.

Can you help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:19:08+00:00Added an answer on May 31, 2026 at 3:19 am

    user1242345, there are two ways to go about it.

    Way 1

    You can launch the URL in WebBrowser1 from VBA and then write to the textbox directly using .GetElementByID

    For example

    WebBrowser1.Document.getElementById("TextBoxName").Value = "Whatever"

    Way 2

    Use XMLHTTP. This is way much faster than Way 1

    If you can share the link then I can give you an exact answer?

    FOLLOWUP

    Thanks for your response.. i can’t give you the link as it’s a password protected page. However here is the html for the form i want to paste into if this helps. pastebin.com/cWrwfKBf – user1242345 17 mins ago

    Both, i would like to copy from cell A1 and paste into Feed_name, then go back to excel and copy from B1, and paste into feed_url. Thanks for your help i really appreciate it. – user1242345 5 mins ago

    I copied the source code in a text file and saved it as Test.Htm on my desktop. Please see the example below on how to write to the first textbox. i am sure you can replicate it for the next 😉

    To run this, create a userform in Excel and place the WebBrowser1 control and a CommandButton Control in the form. See Snapshot.

    SNAPSHOT 1

    enter image description here

    Paste this code in the code area of the userform.

    Private Sub CommandButton1_Click()
        Dim url As String
    
        url = "C:\Documents and Settings\Siddharth Rout\Desktop\Test.Htm"
    
        WebBrowser1.Navigate url
        WaitForWBReady
    
        WebBrowser1.Document.getElementById("feed-create-feed_name").Value = "Whatever"
    End Sub
    
    Private Sub Wait(ByVal nSec As Long)
        nSec = nSec + Timer
        While Timer < nSec
            DoEvents
        Wend
    End Sub
    
    Private Sub WaitForWBReady()
        Wait 1
        While WebBrowser1.ReadyState <> 4
            Wait 3
        Wend
    End Sub
    

    When you click on the button the text gets auto populated as show below.

    SNAPSHOT 2

    enter image description here

    MORE FOLLOWUP

    Unfortunately this is my first time using VB, so i’m failing at creating this loop.. 🙁 – user1242345 2 mins

    I usually don’t post a solution in such a scenario but advise the Asker to learn VBA but since I have already posted a major chunk so I will finish it for you. But any more questions from you this point onwards has to be followed by the code that you have written yourself 🙂

    UNTESTED

    Try this

    Private Declare PtrSafe Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) 
    
    Private Sub CommandButton1_Click()
        Dim ws As Worksheet
        Dim url As String
        Dim lastRow As Long
    
        url = "C:\Documents and Settings\Siddharth Rout\Desktop\Test.Htm"
    
        '~~> This is the sheet where the values has to be picked up from
        Set ws = Sheets("Sheet1") 
    
        With ws
            '~~> Get the Last Row in Sheet1
            lastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    
            '~~> Loop through the range
            For i = 1 To lastRow
                '~~> Navigate to the URL
                WebBrowser1.Navigate url
                WaitForWBReady
    
                '~~> Input Values
                WebBrowser1.Document.getElementById("feed-create-feed_name").Value = .Range("A" & i).Value
                WebBrowser1.Document.getElementById("feed-create-feed_url").Value = .Range("B" & i).Value
    
                '~~> Click Button
                WebBrowser1.Document.getElementsByTagname("Input")(3).Click
    
                WaitForWBReady
            Next
        End With
    End Sub
    
    Private Sub Wait(ByVal nSec As Long)
        nSec = nSec + Timer
        While Timer < nSec
            DoEvents
            Sleep 100
        Wend
    End Sub
    
    Private Sub WaitForWBReady()
        Wait 1
        While WebBrowser1.ReadyState <> 4
            Wait 3
        Wend
    End Sub
    

    HTH

    Sid

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already created a User Model using devise, but I now want to
How can I embed my listview in a layout that I have already created?
I have already created a project in XCode 4.2 with ARC checked. The problem
I have already created UITableViewController embedded in Navigator Controller using Storyboard and Interface Builder.
I have already created my own VOIP server and client using pure sockets. All
I have already created a report using list of data from my database. i
I am confused on one simple situation is that when I have already created
Below is a simplified version of a query that I have already created. The
I have created a macro that opens a excel workbook and performs some operations
I have already created a form authentication application. I had User table and created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.