Hi everybody,
Is there any way to forbid other users to change the author name of excel file?
Please, I realy need to know how to make this.
Thank you verry much
M.
Hi everybody,
Is there any way to forbid other users to change the author name of excel file?
Please, I realy need to know how to make this.
Thank you verry much
M.
Hi,Originally Posted by Mm73
I can't think of any direct way of doing this. The username is a property of the Excel Application, not the Workbook level.
There might be a workaround. You could write the user name away to a hidden cell on a protected worksheet, and then using the Workbook Before_Save event in the VBE, add the following bit of code. Assuming the username is held in a cell which you've named as 'Username'
However you need to be careful with this because you are changing the name that will get applied to all files saved by that user with their Excel Application. You'd be advised if you're going down this route to have VBA code keep track of the Usernames. So in the Workbook_Open event, capture the name of the current user and record it somewhere, say a cell called 'ApplicationOwner'. Then after the line of code above in the Before_Save event, add the line![]()
Application.UserName = Range("Username")
HTH![]()
Application.UserName = Range("ApplicationOwner")
Sorry, that second line of code should be added in the Before_Close event, not the Before_Save event.Originally Posted by Richard Buttrey
However be aware that any other files the user opens and handles after the Save event and before the Close event, will mean that all those other files will record you as the UserName. That may be something you don't wish to happen. I suppose you could devise some code that prevented a user opening a file before you've closed this file, but then you'd still be left with other files that were already open before they opened this file. Again, you could write code to force closure of those other files so that this file is the only one open in memory, but you're getting into a potentiatally unacceptable area.
HTH
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks