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 CopierFichierSharePoint2013()
'par: <!-- m --><a class="postlink" href="http://excel-malin.com">http://excel-malin.com</a><!-- m -->
On Error GoTo Erreur
Dim MonFichier As String
Dim DestinationSharePoint As String
Dim Valeurretour As Long
'Destination URL = "https://monserveur.net/sites/mon-site/Shared Documents/mon-dossier/test.txt"
' => il est nécessaire de le transformer de manière suivante:
DestinationSharePoint = "\\fly.sharepoint.com@SSL\sites\GESCO\Situation relais\Situation demandee.xlsx"
MonFichier = "C:\Users\Desktop\test\Situation demandee.xlsx"
Valeurretour = URLDownloadToFile(0, DestinationSharePoint, MonFichier, 0, 0) 'cette commande fonctionnera dans SharePoint 2013
MsgBox "telechargement réussi..."
Exit Sub
Erreur:
MsgBox "Une erreur est survenue lors du telechargement..."
End Sub