Dateidownload ohne Dialog. Lädt eine beliebige Datei und speichert diese am Zielort.
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
Private Const FileToDownload = "http://www.irgendwer.com/test.html"
Private Const DestFile = "C:\test.txt"
Private Sub Command1_Click()
Dim urlSuccess As Long
' Starte Download
urlSuccess = URLDownloadToFile(0, FileToDownload, DestFile, 0, 0)
Select Case urlSuccess
Case 0
' erfolgreicher Download
MsgBox "Download erfolgreich beendet"
Case Else
MsgBox "Error..."
End Select
End Sub