Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Feed / Post Data on Web Page Using VBA

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    31
    Rep Power
    0

    Exclamation Feed / Post Data on Web Page Using VBA

    Hi

    Thru vba i am trying to open multiple webapage one by one & post a message in form & click submit button.

    How this can be done without opening IE or with navigation option in IE.

    Post command used by webpage is as follows:

    Code:
    <form method="POST" action="community/book_update.asp" onsubmit="return FrontPage_Form2_Validator(this)" language="JavaScript" name="
    <textarea rows="5" name="np_scrap_message" cols="55"></textarea><br class="
    <input type="hidden" value="97039" name="
    <input type="submit" value="Leave Message" name="
    </form>
    Thanks

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Vaibhav, do you want to do this without the user knowing that IE is open? Of course you have to open a web browser, although invisible!
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Junior Member
    Join Date
    Oct 2012
    Posts
    31
    Rep Power
    0
    Any how will be fyne!!

    Thx for reply!

  4. #4
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Can you send the link to this web page? And exactly what you want to do.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  5. #5
    Junior Member
    Join Date
    Oct 2012
    Posts
    31
    Rep Power
    0
    Hi

    I am trying tp webpage one by one & then there on webpage there is a message box where i have to paste message & click on submit.

    code to execute manually is submitted above.

    i cant share web link since only member is allowed to login.

    Thanks!!

  6. #6
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    The below code is just a basic way of doing a simple operation using VBA and IE. Without the actual weblink, it's hard to provide an exact solution....

    Code:
    Dim IE as Object
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate "http://www.yourwebsite.com/form.aspx"
    Do Until IE.LocationURL = ""
        DoEvents
    Loop
    Do Until IE.ReadyState = 4
        DoEvents
    Loop
    
    IE.document.Forms("NameOfForm").elements("TextBox").Value = "Message Here"
    IE.document.Forms("NameOfForm").elements("Submit").click
    
    IE.Quit
    
    End Sub
    Also, search for
    Code:
    getElementsByTagName
    and
    Code:
    getElementByID
    on the net. Might give you some clue....
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  7. #7
    Junior Member
    Join Date
    Oct 2012
    Posts
    31
    Rep Power
    0
    Thanks a ton. I will check & revert on the same!!

  8. #8
    Junior Member
    Join Date
    Oct 2012
    Posts
    31
    Rep Power
    0
    working superb, Thanks!!

  9. #9
    Junior Member
    Join Date
    Oct 2012
    Posts
    31
    Rep Power
    0
    Just one more request, insted of closing IE in the end is it possible to open webpage in new TAB.

    My code goes here..

    Code:
    Sub go()
    Dim IE As Object
    Dim rngRange As Range
    Dim rngCell* As Range
    
    Set IE = CreateObject("InternetExplorer.Application")
    
    Set rngRange = Application.InputBox(prompt:="Please select a range with your Mouse.", _
                   Title:="SPECIFY RANGE", Type:=8)
    
    For Each rngCell In rngRange
    
    IE.Navigate rngCell.Value 
    Do Until IE.LocationURL = ""
        DoEvents
    Loop
    
    'Do Until IE.ReadyState = 4
    '    DoEvents
    'Loop
    
    IE.Visible = True
    IE.document.forms("Form1").elements("text").Value = ActiveSheet.Range("B2").Value '"Message Here"
    IE.document.forms("Form1").elements("submit").Click
    
    IE.Quit
    
    Next rngCell
    
    End Sub
    Thansk once again.

  10. #10
    Junior Member
    Join Date
    Oct 2012
    Posts
    31
    Rep Power
    0
    Opps one more probz..... Too many session of IE remains open in background!!

    And i am getting Run Time Error 91..

    Plz help!!

    Thanks!

Similar Threads

  1. Click On Web Link VBA
    By mrmmickle1 in forum Excel Help
    Replies: 0
    Last Post: 12-11-2012, 09:31 PM
  2. Replies: 2
    Last Post: 09-08-2012, 10:50 PM
  3. Navigate Through Web links and get data
    By maruthi in forum Excel Help
    Replies: 0
    Last Post: 02-10-2012, 06:22 PM
  4. Executing XLSM file on a web page
    By Rasm in forum Excel Help
    Replies: 1
    Last Post: 12-17-2011, 05:38 AM
  5. Capture values from IE page
    By maruthi in forum Excel Help
    Replies: 6
    Last Post: 11-22-2011, 08:25 AM

Posting Permissions

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