• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 952
  • Last Modified:

Why does a user gets a Runtime error 70 with Permission Denied when attempting to delete the XLS files in a folder C:\SENTSPRING on his local drive ?

In my Access application I use Access as the front end and SQL Server as the backend database. In a sub-procedure
I first checks to see whether or not the user has a folder on his local C: Drive and if so, delete all .XLS files within this folder.

I placed the Access adp file on a server. Then a user accesses the apd file on the server. When the application reaches the line:

     Kill "C:\SENTSPRING\*.XLS"  <--------------   this line is highlighted in yellow by the compiler

A runtime error is generated        Runtime Error 70
                                                 Permission Denied

The user does not have permission to delete the XLS files in a folder C:\SENTSPRING on his local drive.

Do you know how I can avoid this error ?

'Kill "C:\IIG\CASH_CONTROL\ccshared\AbandonedProperty\TEST\*.XLS"
    If isFileExist("C:\SENTSPRING\*.XLS") Then
       Kill "C:\SENTSPRING\*.XLS"
    End If
1 Solution
this is likely a windows permissions error.
the user will need to be given full permissions to the folder in question
is the file open?
Another reason that this error can get thrown is that the user actually has the file open in Excel when your code tries to delete it.

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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