Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Businessanalyst
Contributor
Contributor

File copy Permission denied while using filesystem object fso

I am using fso to copy file from local folder to Shareddrive, but I am getting "permission denied" while copying to shareddrive. But it's working fine while I'm doing manually.so I hope no problem with sharedrive access permission.please help me to sort out this issue

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

 

 

Labels (3)
1 Reply
Brett_Bleess
Former Employee
Former Employee

You forgot to explain from where you are trying to run things when it is failing, very pertinent piece of information we need to know in order to answer your question.  I would suspect the issue lies in whatever process you are using to run things when not running directly from the Desktop Client as a logged on user, the account running things otherwise will need to have the proper File Share permissions/NTFS rights in order to do so.  

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.