Excel VBA URLDownloadToFile Error for HTTPSresource
<p>I try to download a file from a Server in Excel using VBA. This works fine when using HTTP, but doesn't work using HTTPS. </p>

<p>I can reach both adresses (HTTP/HTTPS) in Internet Explorer. If I use <code>URLDownloadToFile</code> with the HTTP address the file is downloaded.</p>

<p>When using the <code>HTTPSadress</code> I get return code <code>-2146697211</code>. Maybe this a certificate Problem?</p>

<pre><code>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

Dim Ret As Long

Sub DownloadCode()

Dim strURL As String
Dim strPath As String
strURL = "https:/url.de/module.bas"
strPath = Environ("TEMP") &amp; "\Module.bas"
Ret = URLDownloadToFile(0, strURL, strPath, 0, 0)

If Ret = 0 Then
'   MsgBox "File successfully downloaded"
Else
    MsgBox "Returncode:" &amp; Ret &amp; " Unable to download Code`enter code here`."
End If

End Sub
</code></pre>