Macro que no corre en excel 2013
Tengo la siguiente macro que encontré en un foro, corria perfectamente en la version 2010 de excel, al parecer el error esta en la palabra "lib".
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
Private Const ERROR_SUCCESS As Long = 0
Sub LancementProcedure()
DownloadFile "ftp://ftp.my.com/pack.zip", "C:\pack.zip"
End Sub
'****
Public Function DownloadFile(ByVal sURL As String, ByVal sLocalFile As String) As Boolean
Dim lngRetVal As Long
DownloadFile = URLDownloadToFile(0&, sURL, sLocalFile, 0&, 0&) = ERROR_SUCCESS
End Function