Filedownload von Server geht nicht mehr
05.11.2019 16:53:38
Server
seit langer Zeit nutze ich in einigen meiner Makros die Möglichkeit, Files von Servern herunter _ zu laden und ins Excel zu importieren. Bisher hat das mit
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
und dem Aufruf
Private Sub DownloadLogfilesFromServer()
vSourceFileGt = "http://xxx.xxx/static/igator_files/kwanm.csv"
vLogFileGtName = "kwanm.csv"
vWorkDir = ThisWorkbook.Path
' GT Basisdaten
vDestinationFile = vWorkDir + "/" + vLogFileGtName
' alte Datei loeschen, wenn vorhanden
If Dir(vDestinationFile) "" Then
Kill vDestinationFile
End If
' Download starten und autom. URL-Cache leeren
a = FileDownload(vSourceFileGt, vDestinationFile)
End Sub
Private Function FileDownload(ByVal sURL As String, ByVal sLocalFile As String, Optional ByVal _
bClearCache As Boolean = True) As Boolean
' Download ausführen
vResult = URLDownloadToFile(0, sURL, sLocalFile, 0, 0)
FileDownload = (vResult = 0)
End Function
ganz gut funktioniert. Nunmehr schwenkte meine Verwaltung auf Windows 10 um und es geht eben nicht mehr. Der File-Download wird mit false quittiert. Und ja: das File liegt an dem angegebenen Platz.Hat jemand eine Idee, woran es liegt, dass jahrelang Bewährtes nicht mehr funkt?
Vielen Dank!
Mark