Home |
Search |
Today's Posts |
#1
|
|||
|
|||
how can I protect workbook on a drive from deletion
I am trying to see if there is a way to protect a worksheet for being deleted
on a shared drive. |
#2
|
|||
|
|||
Put it on a shared drive where the users only have read access.
Gamez302 wrote: I am trying to see if there is a way to protect a worksheet for being deleted on a shared drive. -- Dave Peterson |
#3
|
|||
|
|||
I need my team to be able to add names in the worksheet. For the past couple
of days it has been deleted from our shared drive and all our data is lost. I am wondering if we can put a password or anything to prevent this from happening again. "Dave Peterson" wrote: Put it on a shared drive where the users only have read access. Gamez302 wrote: I am trying to see if there is a way to protect a worksheet for being deleted on a shared drive. -- Dave Peterson |
#4
|
|||
|
|||
This cannot be done through Excel.
If running WindowsXP or any NT OS you can set folder and file permissions. See OS Help on "permissions" and then select "File and Folder Permissions" Also look up "user Accounts" Gord Dibben Excel MVP On Fri, 20 May 2005 11:56:01 -0700, "Gamez302" wrote: I need my team to be able to add names in the worksheet. For the past couple of days it has been deleted from our shared drive and all our data is lost. I am wondering if we can put a password or anything to prevent this from happening again. "Dave Peterson" wrote: Put it on a shared drive where the users only have read access. Gamez302 wrote: I am trying to see if there is a way to protect a worksheet for being deleted on a shared drive. -- Dave Peterson |
#5
|
|||
|
|||
And more bad news. If you could prevent the deletion of the workbook, you'd
break the way excel works. When excel saves the file, it saves it as a temporary file with a funny name (8 characters--no extension). If the save is successful, xl will delete the original (or rename it to its backup name (like "backup of book1.xlk)) and if that's successful, xl will rename the funny named file to the original's name. So I'm not sure you could ever accomplish what you want. Maybe a work-around. You could create a backup copy of the workbook whenever anyone saves the workbook. I'd use the date/time as part of the filename so that I could keep track of the most current. And every so often, I'd go into that backup folder and clean it up (manually). Option Explicit Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim myFileName As String Dim myFolderName As String myFolderName = Me.Path & "\backup" On Error Resume Next MkDir myFolderName On Error GoTo 0 myFileName = myFolderName & "\" & Left(Me.Name, Len(Me.Name) - 4) _ & "_" & Format(Now, "yyyymmdd_hhmmss") & ".xls" ThisWorkbook.SaveCopyAs Filename:=myFileName End Sub This kind of code goes into the ThisWorkbook module. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Failing this kind of thing, I think the best thing to do is to make and keep plenty of backups. Gamez302 wrote: I need my team to be able to add names in the worksheet. For the past couple of days it has been deleted from our shared drive and all our data is lost. I am wondering if we can put a password or anything to prevent this from happening again. "Dave Peterson" wrote: Put it on a shared drive where the users only have read access. Gamez302 wrote: I am trying to see if there is a way to protect a worksheet for being deleted on a shared drive. -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HOW DO I SUM TWO CELLS FROM ONE WORKBOOK TO ANOTHER WORKBOOK? | Excel Worksheet Functions | |||
Auto Protect workbook with password upon opening | Excel Worksheet Functions | |||
Unprotect Workbook | Excel Discussion (Misc queries) | |||
protect a workbook from being deleted | Excel Discussion (Misc queries) | |||
Stubborn toolbars in Excel | Excel Discussion (Misc queries) |