Solved

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

Posted on 2014-09-18
4
148 Views
Last Modified: 2014-09-18
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
Comment
Question by:Tocogroup
  • 2
  • 2
4 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
Comment Utility
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
 

Author Comment

by:Tocogroup
Comment Utility
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
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
Comment Utility
Right-hand click on the folder, go to Properties, and look at the Security tab.
0
 

Author Closing Comment

by:Tocogroup
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now