title: Excel 2013 VBA Error
body: <p>I am getting following error.</p>
  
  <pre><code>Compile error: The code in this project must be updated for use on 64-bit systems.
  </code></pre>
  
  <p><strong>VBA CODE</strong></p>
  
  <pre><code>Option Explicit
  
  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
  
  '~~&gt; This is where the images will be saved. Change as applicable
  Const FolderName As String = "C:\Temp\"
  </code></pre>
  
  <p>It works fine in Excel 2010.</p>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Error I get is <code>Ret Variable Not defined</code>. Here's the rest of the code. </p>
  
  <pre><code>Sub Sample()
      Dim ws As Worksheet
      Dim LastRow As Long, i As Long
      Dim strPath As String
  
      '~~&gt; Name of the sheet which has the list
      Set ws = Sheets("Sheet1")
  
      LastRow = ws.Range("A" &amp; Rows.Count).End(xlUp).Row
  
      For i = 2 To LastRow '&lt;~~ 2 because row 1 has headers
          strPath = FolderName &amp; ws.Range("A" &amp; i).Value &amp; ".mp3"
  
          Ret = URLDownloadToFile(0, ws.Range("B" &amp; i).Value, strPath, 0, 0)
  
          If Ret = 0 Then
              ws.Range("C" &amp; i).Value = "File successfully downloaded"
          Else
              ws.Range("C" &amp; i).Value = "Unable to download the file"
          End If
      Next i
  End Sub
  </code></pre>