[vba]Option Explicit

Private Declare Function URLDownloadToFileA Lib "urlmon" (ByVal pCaller As Long, _
ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Private Sub Example()
'From All API
'example by Matthew Gates (Puff0rz@hotmail.com)
DownloadFile _
"http://www.vbaexpress.com/forum/attachment.php?attachmentid=2305&d=1258660962", _
"C:\Test\TestDownload.zip"
End Sub

Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFileA(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function[/vba]