Option Explicit
#If VBA7 Then
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 Long
#Else
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
#End If
Sub Unzip()
Dim WS As Object, ShApp As Object
Dim répertoire_zip As String, répertoire_unzip As Variant, URL As String, nom_fichier As Variant
Dim code_retour As Integer
'// Assignation répertoires
Set WS = CreateObject("WScript.Shell")
répertoire_zip = WS.SpecialFolders("Desktop")
répertoire_unzip = WS.SpecialFolders("MyDocuments")
'// Téléchargement fichier
URL = "https://www.insee.fr/fr/statistiques/serie/telecharger/001710986?ordre=antechronologique&transposition=donneescolonne&periodeDebut=1&anneeDebut=2020&periodeFin=10&anneeFin=2020"
nom_fichier = répertoire_zip & "\" & "Save.zip"
code_retour = URLDownloadToFile(0, URL, nom_fichier, 0, 0)
If code_retour = 0 Then MsgBox "Téléchargement effectué" Else Exit Sub
'// Dézippage fichier
Set ShApp = CreateObject("Shell.Application")
ShApp.Namespace(répertoire_unzip).CopyHere ShApp.Namespace(nom_fichier).items
End Sub