'Move files between folders in the server with vba
I'm trying to move a pdf file from a folder to another both located in the server (a Teams sharepoint).
I've used the code below (which is working perfectly on local) but i got the following error :

PS : I tried to access the "SourceFileName1" when debugging by copy paste in my browser and the file is here
Dim FSO As Object
Dim SourceFileName As String, DestinFileName As String
Set FSO = CreateObject("Scripting.Filesystemobject")
SourceFileName1 = "https://comxx.sharepoint.com/.../folder1/myfile.pdf"
DestinFileName1 = "https://comxx.sharepoint.com/.../folder2/myfile.pdf"
FSO.MoveFile Source:=SourceFileName1, Destination:=DestinFileName1
I've tried also with a path like this "\\comxx.sharepoint.com....\myfile.pdf" i got another error (below). I thought it was a permission issue but in my code i'm exporting this file (myfile) into the folder1 without problem.

Do you have any idea about how to handle with this issue ? Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
