PDA

View Full Version : copy web data help



KK1966
05-30-2011, 03:19 AM
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

Kenneth Hobs
05-30-2011, 08:32 AM
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

KK1966
05-31-2011, 07:51 PM
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

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 ?

KK1966
06-01-2011, 08:22 AM
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