Downloading file from web


I am trying to download an image from the web using VBA code like:

Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ( _
ByVal pCaller As LongPtr, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As LongPtr, _
ByVal lpfnCB As LongPtr) As LongPtr

Sub DownloadSingleFile()

FileURL = "">"

DestinationFile = "C:\my files\engine.jpg"
If URLDownloadToFile(0, FileURL, DestinationFile, 0, 0) = 0 Then
Debug.Print "File downloaded"
Debug.Print "File download not downloaded"
End If
End Sub

When I run this code in Excel, it downloads the file, but same code does not download file in CorelDraw.  What could be possibly wrong? 

Thanks in advance for your help.

Kind Regards.