none
How I can copy and Paste value in two web page using vba excel? RRS feed

  • Question

  • Hi everybody,

    I am trying to control internet explorer from <acronym style="cursor:help;">vba</acronym> excel. Everything is going fine. I have only one problem. I have no clue how to open two tabs in internet exlplorer ( but I know how to open two windows internet explore) and use one as source and the other as input platform. For example: let assume that in the first tab I have all information(name, last name , date of birth) that I need to fill a form in the second tab. How I can copy from the first tab and paste it on the second one?


    Thursday, September 11, 2014 8:53 PM

All replies

  • Is this is a public web site, or something behind a firewall, and inside your firm?

    Please consider this . . . .

    How do I pass the array to the HTML textbox?
    For example as follows:

    Sub CreateArrayAndPassToHTMLTextbox()
       Dim ie  As Object
       Dim arr As Variant
    
       Const DELIMITER = ","
    
       Set ie = CreateObject("InternetExplorer.Application")
    
       ie.Visible = True
       ie.navigate "http://home.arcor.de/peter.schleif/SearchForTDelement.html"
       While ie.Busy: DoEvents: Wend
    
       With ActiveSheet
          arr = WorksheetFunction.Transpose(.Range(.[A1], .Cells(Rows.Count, "A").End(xlUp)))
          If Not IsArray(arr) Then arr = Array(arr)
          ie.document.getElementById("trackField").Value = Join(arr, DELIMITER)
       End With
    End Sub
    

    Or, this . . .

    Sub CreateArrayAndPassToHTMLTextbox2()
       Dim ie  As Object
       Dim arr As Variant
    
       Const DELIMITER = vbCr
    
       Set ie = CreateObject("InternetExplorer.Application")
    
       ie.Visible = True
       ie.navigate "http://home.arcor.de/peter.schleif/SearchForTDelement.html"
      'ie.navigate "http://localhost/test/SearchForTDelement.html"
       While ie.Busy: DoEvents: Wend
    
       With ActiveSheet
          arr = WorksheetFunction.Transpose(.Range(.[A1], .Cells(Rows.Count, "A").End(xlUp)))
          If Not IsArray(arr) Then arr = Array(arr)
          ie.document.getElementById("trackField").Value = Join(arr, DELIMITER)
       End With
    End Sub
    

    Let me know if you have any questions.



    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Friday, September 12, 2014 2:11 AM