Web-stripping is possible, but a royal pain. First, you need to read the site. This depends on the language used. For example, in VB6, you would use an INet ActiveX object and code something like:
Code:
Inet2.URL = "http://xxxxxxxxx"
Inet2.Protocol = icHTTP
Private Sub Inet2_StateChanged(ByVal State As Integer)
If State = 12 ThenDoXXX
End Sub
Public Sub DoXXX()
Dim vtData$
NBuff = ""
vtData = Inet2.GetChunk(1024, icString)
Do While LenB(vtData) > 0
NBuff = NBuff & vtData
vtData = Inet2.GetChunk(1024, icString)
Loop
End Sub
Then, you would have to parse the result in NBuff.
Then, you would need to get it into Excel. You can create a CSV file and invoke Excel. That’s the easy way. But, if you want to feed it into a current Excel spreadsheet, that is quite difficult and depends on the version of Excel that you have as they keep changing the damn method. Here’s a simple example from CVData of copying some data to Excel using the Excel 14.0 object model:
Code:
If Not linkactive Then
Set xxxapp = CreateObject("Excel.Application")
Set xxxobjex = CreateObject("Excel.sheet")
xxxobjex.Application.Visible = True
linkactive = True
DoEvents
Else
If nam.namsimtable <> OldSimtable Then
xxxobjex.ActiveSheet.Cells.ClearContents
xxxobjex.ActiveSheet.Cells.ClearFormats
OldSimtable = nam.namsimtable
End If
End If
DoEvents
With frmsimout.G1
.Row = 0
.Col = 0
.RowSel = .Rows - 1
.ColSel = .Cols - 1
Clipboard.Clear
Clipboard.SetText .Clip
End With
With xxxobjex.ActiveSheet
.Paste Destination:=.Range(.Cells(1, 1), .Cells(frmsimout.G1.Rows, frmsimout.G1.Cols))
End With
If err <> 0 Then
Set xxxapp = CreateObject("Excel.Application")
Set xxxobjex = CreateObject("Excel.sheet")
xxxobjex.Application.Visible = True
DoEvents
With xxxobjex.ActiveSheet
.Paste Destination:=.Range(.Cells(1, 1), .Cells(frmsimout.G1.Rows, frmsimout.G1.Cols))
End With
On Error GoTo 0
End If
Bookmarks