# How to disable rename and prevent from delete an excel file by VBA



## alamgirjuab (Apr 28, 2017)

Hi,
This is Alamgir. I have a multi functional excel file. I want nobody can delete or rename this file without my permission. If it is possible by VBA or other something like that Please inform me anyone. I don't want to use any external software, I want to build up my own way. I am waiting for kind response of any experienced person...............


----------



## Joe4 (Apr 28, 2017)

I moved this question to the "General Excel & Other Discussions" questions, as I think the answer may be something non-Excel related.
I doubt a VBA solution will work, because VBA can easily be disabled (and often is, by default).  And you cannot force VBA to run (that would be a huge security issue!).

I have seen some people hide all the sheets/data in their file, so that the only way a person can view it is to allow VBA, which will then unhide the sheets/data for them.
So while you cannot force VBA, you can strongly encourage people to enable it (by making the file virtually unusable if they do not).

I will be interested to see what suggestions people may have.


----------



## Macropod (Apr 29, 2017)

VBA in a closed workbook cannot prevent the workbook being deleted or renamed. Period. Any such restrictions would have to be imposed at the operating system/network level.


----------

