I am trying to write a procedure in PowerPoint 2003 that will automatically update the installed add-in. The overall process is as follows:
Remove add-in
For Each objAddIn In Application.AddIns
If UCase(objAddIn.Name) = UCase(AddInName) Then
With objAddIn
.Registered = msoFalse
.AutoLoad = msoFalse
.Loaded = msoFalse
End With
End If
Next
Delete the file from the local add-ons directory
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(FileName) Then
Set objFSO = Nothing
Kill FileName
End If
Copy file from network location
Install updated add-in
After reaching step 2, any attempt to delete a file after deleting using either FileSystemObject or a direct one Killinevitably creates Run-time error '70': Permission denied. If I remove Debug and then play, it runs as if there was never a problem.
Side note: I understand that I can use FSO to overwrite a local file, but this gives me the same error at runtime.
, , , "" , .
- , ?