Lock File Name

Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,074
Office Version
  1. 2019
Platform
  1. Windows
Is it possible to prevent the user from changing the file's name?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Not really, unfortunately.

You can use the open event to test for the wb name I suppose and resave it if it's changed, and the before save event to make sure it's not saved as something else, but it can be defeated by disabling macros. One of the inherent problems with any file I suppose.

Without network file control/permissions, there's nothing keeping a user from renaming a file, but you need to have a pretty good relationship with IT to do that, and that often comes at the cost of pissing off users because their abilities become limited.

I ran into it all the time at my last job with dipschnzit users who just couldn't grasp that certain files needed to be named a certain way for code to work... :( I can't tell you how many "it doesn't work anymore" calls I used to get because some dumba$$ renamed a file "Dumb User's Name Call Report"...

The trick with sneaky users is not teaching them anything lest they get wise!

Unfortunately it ain't the sneaky ones you have to worry about here.
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,309
Members
448,886
Latest member
GBCTeacher

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top