Consulting

Results 1 to 4 of 4

Thread: copy web data help

  1. #1
    VBAX Contributor
    Joined
    Jun 2008
    Posts
    169
    Location

    copy web data help

    hi,
    Can I have excel get the data from Internet Explorer ? All I'd need is to have the Marcos go to a specific URL and do a select all + copy.
    Is this possible using VBA? Can someone help me the code?
    I am using Excel 2003 and IE 8

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    [VBA]Sub Test2()
    Dim lnk As Object, ie As Object, doc As Object, i As Long
    Set ie = CreateObject("InternetExplorer.Application")
    With ie
    .Visible = True
    .navigate "http://www.vbaexpress.com/forum/showthread.php?t=37612"
    Do Until .readyState = 4: DoEvents: Loop
    Set doc = ie.document
    .ExecWB 17, 0 '// SelectAll
    .ExecWB 12, 2 '// Copy selection
    .Quit
    End With
    Set ie = Nothing
    Range("A1").PasteSpecial
    End Sub[/VBA]

  3. #3
    VBAX Contributor
    Joined
    Jun 2008
    Posts
    169
    Location
    Quote Originally Posted by Kenneth Hobs
    [VBA]Sub Test2()
    Dim lnk As Object, ie As Object, doc As Object, i As Long
    Set ie = CreateObject("InternetExplorer.Application")
    With ie
    .Visible = True
    .navigate "http://www.vbaexpress.com/forum/showthread.php?t=37612"
    Do Until .readyState = 4: DoEvents: Loop
    Set doc = ie.document
    .ExecWB 17, 0 '// SelectAll
    .ExecWB 12, 2 '// Copy selection
    .Quit
    End With
    Set ie = Nothing
    Range("A1").PasteSpecial
    End Sub[/VBA]
    Hi, Kenneth Hobs
    thanks the great help which was work for me, but some was problem is pasted value part of them format converted?
    since on web page value is "00/00" changed to date format "dd/mm" after paste on excel.
    can it be fix ?

  4. #4
    VBAX Contributor
    Joined
    Jun 2008
    Posts
    169
    Location
    Quote Originally Posted by KK1966
    Hi, Kenneth Hobs
    thanks the great help which was work for me, but some was problem is pasted value part of them format converted?
    since on web page value is "00/00" changed to date format "dd/mm" after paste on excel.
    can it be fix ?

    Hi, Kenneth
    I get it work and thanks so much

Posting Permissions

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