File copy Permission denied using file system object

Joined
Mar 14, 2020
Messages
2
Reaction score
0
I am trying to copy file from local to shareddrive where I am getting permission denied error. But I am able to copy manually it's working fine.
 
Joined
Mar 14, 2020
Messages
2
Reaction score
0
i am trying to copy files from localfolder to sharedpoint where i am getting error 70 "Permission denied" . but when i copy paste manually its working fine. i dont have any problem in folder permission , only issues is using FSO. can anyone guide me on it.

Sub Copy_d()
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
FromPath = "give excel path" ToPath = "give share point path"
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " Path doesn't exist"
Exit
Sub End
If FSO.CopyFolder Source:=FromPath, Destination:=ToPath
MsgBox " copied " & ToPath
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top