Below is my current code which worked perfectly fine when the file was saved on my local drive. Now that I have migrated to all sharepoint versions of this it doesn't seem to work. All of the files remain in the sharepoint folder even after the macro has run. I have delete privledges within the sharepoint. I think something is just missing, or the method I'm using doesn't translate into sharepoint?
Is anyone familiar with this and can help?
The code essentially goes to the place where the workbook is stored, then into the folder "Files" and deletes all contents of that folder.
Sub DeleteOldFiles()
'Will delete all files within saved folder for old files
Dim xPath As String
xPath = Application.ActiveWorkbook.Path & "\Files\*.*"
On Error Resume Next
Kill xPath
On Error GoTo 0
MsgBox ("Deleted")
End Sub
Is anyone familiar with this and can help?
The code essentially goes to the place where the workbook is stored, then into the folder "Files" and deletes all contents of that folder.
Sub DeleteOldFiles()
'Will delete all files within saved folder for old files
Dim xPath As String
xPath = Application.ActiveWorkbook.Path & "\Files\*.*"
On Error Resume Next
Kill xPath
On Error GoTo 0
MsgBox ("Deleted")
End Sub