Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

How do I resolve my 'Error 70 Permissions denied' issue in Excel VBA ?

Hi All,

I've developed a small VBA procedure which amongst other things copies a file to a folder. It works fine for me.

However, my business colleague, for whom I wrote it, is getting a 'Error 70 Permissions denied' failure when he runs the procedure, even though it's his file it's failing on.

I've included the code below just to give you the context but I'm sure this is something other than a coding error.

    Set fs = CreateObject("Scripting.FileSystemObject")

    strInputFolder = "Z:\Docs\Status Report\Data\Input"
    strArchiveFolder = "Z:\Docs\Status Report\Data\Archive"
    strTemplateFolder = "Z:\Docs\Status Report\Data"
    Set r = fs.GetFolder(strInputFolder)

    For Each f In r.Files
       'Check if a IE browser hidden file and ignore it
       If UCase(f.Name) <> "THUMBS.DB" Then
          ' Copy the input .xlsb file to the Archive folder
          fs.CopyFile strInputFolder & "\" & f.Name, strArchiveFolder & "\Input\" & f.Name

       ....etc etc.....

Open in new window


What are the circumstances when this error is generated ? What do I need to check ?

Suggestions please
Thanks
Toco
0
Tocogroup
Asked:
Tocogroup
  • 2
  • 2
1 Solution
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
The file is being copied to Z:\Docs\Status Report\Data\Archive\Input\ - is that what we are expecting?

If so, does your business colleague have write permissions to that folder?
0
 
TocogroupAuthor Commented:
Yes, that is correct. It fails on the copy file command.

How do I find out if he has write permissions for that folder ?
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
Right-hand click on the folder, go to Properties, and look at the Security tab.
0
 
TocogroupAuthor Commented:
Well done. Another learned.
Here goes. I've awarded you the points. Hope it works else I'll do it this evening from home.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now