Hallo,
ich möchte eine Txt oder sonst eine Datei von www.meineHomepage.de aus dem Internet laden.
Dies soll quasi als Lizens gelten. Funzt der download, weil die Datei vorhanden ist, kann der User weitermachen. Wenn ich die Datei von meiner HP nehme, soll der User nicht weiter arbeiten können.
ich wollte das so machen:
Option Explicit
Private Declare
Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" ( _
ByVal pCaller As Long, _
ByVal szURL$, _
ByVal szFileName$, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Public sLocalFile As String
Sub Datei_Download()
Dim lResult As Long
Dim sURL As String
On Error GoTo zError
sURL = "http:\www.xyz.de\Lizens.txt"
sLocalFile = Application.DefaultFilePath & "\" & "Lizens.txt"
lResult = URLDownloadToFile(0, sURL, sLocalFile, 0, 0)
Exit Sub
zError:
MsgBox "nix geht mehr"
End Sub
Problem:
1. Der Download funzt nicht.
2. Obwohl er nicht funzt kommt es nicht zu zError
Was mach ich falsch?
Viele Grüße aus Hamburg
Ray