Solved

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

Posted on 2014-09-18
4
153 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
ID: 40330527
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
ID: 40330572
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
ID: 40330581
Right-hand click on the folder, go to Properties, and look at the Security tab.
0
 

Author Closing Comment

by:Tocogroup
ID: 40330706
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

808 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