Here it is :
Macro in the target file :
Sub delete()
Dim strPath As String, strName As String
strPath = ActiveWorkbook.FullNames
strName = ActiveWorkbook.Name
workbooks.Open FileName:=(Activeworkbook.Path & "\Buffer.xlsm")
Dim wb As Workbook
Set wb = Workbooks("Buffer.xlsm")
wb.Worksheets("Sheet1").Range("A1").Value = strPath
wb.Worksheets("Sheet1").Range("A2").Value ) strName
Application.Run ("Buffer.xlsm!Macro")
End Sub
Macro in the buffer file :
Sub Macro()
Dim strPath As String, strName As String
strPath = Workbooks("Buffer.xlsm").worksheets("Sheet1").Range("A1").Value
strName = Workbooks("Buffer.xlsm").worksheets("Sheet1").Range("A2").Value
Workbooks(strName).Close False
Kill strPath
Workbooks("Buffer.xlsm").Close False
End Sub
In the end, the target file still remains undeleted, and Buffer.xlsm doesn't even close...
I have genuinely no idea why it doesn't do the job...
EDIT : I found out that the buffer's macro stops after closing the first file... The following appears to work, though !
So I just have to find why it breaks here, and how to fix it !
Bookmarks