PDA

View Full Version : Not delete or move an excel file



ioncila
01-28-2010, 08:26 AM
Hi there

This would be great :)

Is there a way to prevent users to not delete a certain workbook or move it to other location?

Or instead

Only permit deletion / moving under a password entering?

Thanks in advance

ioncila
01-30-2010, 08:53 AM
I've been searching hard in the vba Help (delete method, filesystemobject, ...) and in the net in other forums.

I guess this can not be done :(

mikerickson
01-31-2010, 01:24 AM
Its not an Excel issue. Deleteing, naming and moving files is an OS issue.

You could concevably write a Workbook_Open event that makes a workbook useless unless it is in a particular file location with a particular name. But that wouldn't prevent deletion and would annoy users.

ioncila
01-31-2010, 09:08 AM
That's what I was afraid it would be.

One of the guys at work had occasionally deleted a small but important data base. I have to find a way to create an auto backup, a kind of a clone of the file with automatic update. Can this be possible?

mikerickson
01-31-2010, 01:21 PM
SaveAs>Options has an Always Create Backup checkbox.

Aussiebear
02-01-2010, 08:35 PM
Why not have an "On Opening" event to copy the workbook to a safe location?

mdmackillop
02-02-2010, 06:28 AM
You could also use SaveCopyAs to create backup copies in another location

ioncila
02-03-2010, 05:11 AM
You could also use SaveCopyAs to create backup copies in another location

Hi
Is there a way to make it through VBA in this mode:

everytime the workbook is opened, save a copy (with an approprite name) to another location and delete replacing the existing copy (with the same name) in thatlocation?

Thanks

mdmackillop
02-03-2010, 10:23 AM
Private Sub Workbook_Open()
If ActiveWorkbook.Name = "Test.xls" Then
ActiveWorkbook.SaveCopyAs "C:\AAA\Testing.xls"
End If
End Sub

ioncila
02-04-2010, 09:34 AM
Why simple things are the hardest to do?

That's EXACTLY what I was looking for.

Thank you very much