Using kill() - VBA script error with sharepoint path not Windows Path

Viewed 31

The following code runs just fine when ActiveWorkbook.path is equal to a Windows path explorer path like:

**C:\User\John**

But gives an error of "Run-Tie Error 53 - File Not Found" on the line Kill() when ActiveWorkbook.path is equal to a SharePoint path like:

**https://mycompany.sharepoint.com/sites/acctsdept**

How can i fix this code to accept a web/sharepoint path?

Here is the current code:

flnameM = ActiveWorkbook.Path + "\" + folder + "\" + ManualFile
If Len(flnameM) <> 0 Then
    reply = MsgBox("File - " + flnameM + " already exists. Replace?", vbOKCancel)
    If reply = vbCancel Then
        End
    Else
        Kill (flnameM)
    End If
End If

enter image description here

0 Answers
Related