Solved

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

Posted on 2014-09-18
4
155 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

829 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