Solved

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

Posted on 2014-09-18
4
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

733 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