Bonjour,

J'ai besoin de récupérer des données à partir d'une feuille Excel présente dans un SharePoint (Teams). J'ai essayé ce code mais il marche pas:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Option Explicit
Private Declare PtrSafe 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 TelechargerFichierDeSharepoint()
 
    Dim CheminDestination As String
    Dim ValeurRetour As Long
    Const URLSharePoint As String = "https://xx.sharepoint.com/sites/xx/_layouts/15/Doc.aspx?OR=teams&action=edit&sourcedoc={E11C634F-F3D8-4D4F-A1B1-9FC4097B93F2}"
    CheminDestination = "C:\Desktop\Situation Partagé.xlsx"
    ValeurRetour = URLDownloadToFile(0, URLSharePoint, CheminDestination, 0, 0)
 
End Sub
Quelqu'un a une idée SVP ? Merci d'avance