Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Prevent someone from renaming a workbook


Hi,

I programmed a macro that disables the "save as" function so that user
won't be able to "save as" and rename the workbook to something els
(for security purposes).

However, users can still rename it manually outside the workbook. I
there a way that I can program something in VBA or somewhere else t
prevent users from manually renaming a workbook?

Many thanks!!

--
Sethaholi
-----------------------------------------------------------------------
Sethaholic's Profile: http://www.excelforum.com/member.php...fo&userid=2511
View this thread: http://www.excelforum.com/showthread.php?threadid=56753

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Prevent someone from renaming a workbook

There is nothing you can do about a user renaming the file. File naming is
handled by the operating system. You could write some code in the
Workbook_Open event in the ThisWorkbook module that checks the file name and
responds appropriately... something like this:

Private Sub Workbook_Open()
If ThisWorkbook.Name < "Whatever.xls" Then
MsgBox "Bad file name"
End If
End Sub
--
HTH...

Jim Thomlinson


"Sethaholic" wrote:


Hi,

I programmed a macro that disables the "save as" function so that users
won't be able to "save as" and rename the workbook to something else
(for security purposes).

However, users can still rename it manually outside the workbook. Is
there a way that I can program something in VBA or somewhere else to
prevent users from manually renaming a workbook?

Many thanks!!!


--
Sethaholic
------------------------------------------------------------------------
Sethaholic's Profile: http://www.excelforum.com/member.php...o&userid=25113
View this thread: http://www.excelforum.com/showthread...hreadid=567534


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Prevent someone from renaming a workbook


Thanks for the help and response! You are awesome.

One thing though, I like the concept of preventing someone from openin
a workbook if the workbook name has changed, but in my case, the file
are created and named in a very complex way. For example, a file nam
is created for the file depending on the date and time that it i
downloaded. So the file name could be something lik
WBBI_2006073116434. I don't want users to be able to rename the file
yet if they do rename the file manually, then they won't be able t
access the workbook (which is good). However, they probably won't b
able to remember the "old" filename, so they will never be able t
access the file again. What can I do to solve this?

Any advice at all would be very helpful. Thanks again!

--
Sethaholi
-----------------------------------------------------------------------
Sethaholic's Profile: http://www.excelforum.com/member.php...fo&userid=2511
View this thread: http://www.excelforum.com/showthread.php?threadid=56753

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Prevent someone from renaming a workbook

If you can arrange for the WB to be saved to a folder where users do not
have permission to do that, you can leave to the OS.
Otherwise, when the WB is saved with it's legitimate name, store that name
some in the WB; on a hidden sheet or may be .CustomProperty.
Then when it's opened, you can see if it has changed and react accordingly.

NickHK

"Sethaholic" wrote
in message ...

Thanks for the help and response! You are awesome.

One thing though, I like the concept of preventing someone from opening
a workbook if the workbook name has changed, but in my case, the files
are created and named in a very complex way. For example, a file name
is created for the file depending on the date and time that it is
downloaded. So the file name could be something like
WBBI_2006073116434. I don't want users to be able to rename the file,
yet if they do rename the file manually, then they won't be able to
access the workbook (which is good). However, they probably won't be
able to remember the "old" filename, so they will never be able to
access the file again. What can I do to solve this?

Any advice at all would be very helpful. Thanks again!!


--
Sethaholic
------------------------------------------------------------------------
Sethaholic's Profile:

http://www.excelforum.com/member.php...o&userid=25113
View this thread: http://www.excelforum.com/showthread...hreadid=567534



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 97 - Prevent Renaming/Deleting Protected Worksheet Barbarr_ON Excel Programming 4 August 2nd 04 01:46 AM
Workbook renaming billyb Excel Programming 3 May 31st 04 04:05 PM
Workbook renaming! aiyer[_21_] Excel Programming 1 May 12th 04 08:03 PM
Renaming workbook! aiyer[_20_] Excel Programming 1 May 11th 04 11:34 PM
Renaming Sheets in a workbook Cameron MacRae Excel Programming 2 December 18th 03 11:19 PM


All times are GMT +1. The time now is 04:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"