Hi,
I wanted to self delete the excel - vba project when pressed on exit button. It doesn't self delete the excel instead it gives me permission denied error(error1.jpg) also find the code for the self deleting the excel.
Just few background why iam trying to self delete the same excel, first time user will be opening the excel - vba project from a site and using it. When user open it from the site second time it prompt that the excel is read-only and that's because of the duplicate file lying in temp folder. When they open it readonly and run the project it gives a runtime error, but if they download it to desktop and use it it doesn't give any error.![]()
Private Sub ExitButton1_Click() Dim strPath As String strPath = ActiveWorkbook.FullName Kill strPath ThisWorkbook.Close False End Sub
In order to delete the file at first time they open and after using it.
Please let me know how to solve this problem. Please Help!
Bookmarks