I have code that copies an .xls file from a USB to a folder on my PC:
Private Sub data_backup_Click()
On Error Resume Next
Kill "C:\test\LATHE_DATA.xls"
On Error GoTo 0
MsgBox "Ensure USB is inserted"
FileCopy "\\Client\A$\GeneralUSB_sda1\LATHE_DATA.xls", "C:\test\LATHE_DATA.xls"
MsgBox "Backup Completed"
End Sub
The problem is that when I run the code I get the runtime error 70 permission denied message. Is this because the .xls file I am trying to overwrite is being used as a linked table?
If so how do I overcome this problem?
Thanking you in advance
Private Sub data_backup_Click()
On Error Resume Next
Kill "C:\test\LATHE_DATA.xls"
On Error GoTo 0
MsgBox "Ensure USB is inserted"
FileCopy "\\Client\A$\GeneralUSB_sda1\LATHE_DATA.xls", "C:\test\LATHE_DATA.xls"
MsgBox "Backup Completed"
End Sub
The problem is that when I run the code I get the runtime error 70 permission denied message. Is this because the .xls file I am trying to overwrite is being used as a linked table?
If so how do I overcome this problem?
Thanking you in advance
Last edited: