Hi all,
This is the method I used to save and web page locally, in order to extract an html table I want to paste on a worksheet:
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Sub test()
MsgBox DownloadFile(" "C:\test.txt"
End Sub
=================================
I still need to copy what's between the <BODY> ...</BODY> tags to paste it into a worksheet. Any hints on how to do that.
Thanks,
Seb
This is the method I used to save and web page locally, in order to extract an html table I want to paste on a worksheet:
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Sub test()
MsgBox DownloadFile(" "C:\test.txt"
End Sub
=================================
I still need to copy what's between the <BODY> ...</BODY> tags to paste it into a worksheet. Any hints on how to do that.
Thanks,
Seb