1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| 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
Sub recaplot1()
Dim CheminDestination As String
Dim ValeurRetour As Long
'l'adresse url du fichier sur Sharepoint
Const URLSharePoint As String = "https://liensharepoint/Seclin du jour.xlsx"
'chemin et le nom de la destination
CheminDestination = "C:\Macro\Seclin du jour.xlsx"
'lance le téléchargement
ValeurRetour = URLDownloadToFile(0, URLSharePoint, CheminDestination, 0, 0)
End sub |
Partager