Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto-save worksheet on close?
Hello!
At work we have a worksheet that is always open. A lot of people are adding data to the file (on only one computer). But we have a problem; people are shutting down excel and pressing "no" on the "Do you want to save changes"-notification. So; How could I disable the notification, and instead put on a macro like this; Private Sub Worksheet_Close() Worksheet.Save End Sub ________________________________ Well, I'm no programmer, so it's surely not right, but how could I easily do what I want? Thanks. Øystein |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto-save worksheet on close?
Hi
You could enter something like the following in the Workbook module Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.DisplayAlerts = False If ActiveWorkbook.ReadOnly = True Then ActiveWorkbook.Close SaveChanges:=False Exit Sub Else ActiveWorkbook.Close SaveChanges:=True End If Application.DisplayAlerts = True End Sub This will check to see that the file has not been opened as Read Only, and if not, it will save it before closing regardless of any choices made by the user. -- Regards Roger Govier wrote: Hello! At work we have a worksheet that is always open. A lot of people are adding data to the file (on only one computer). But we have a problem; people are shutting down excel and pressing "no" on the "Do you want to save changes"-notification. So; How could I disable the notification, and instead put on a macro like this; Private Sub Worksheet_Close() Worksheet.Save End Sub ________________________________ Well, I'm no programmer, so it's surely not right, but how could I easily do what I want? Thanks. Øystein |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
save a worksheet | Excel Discussion (Misc queries) | |||
Comparing a list to a Calendar worksheet. | Excel Worksheet Functions | |||
How can I create a button to save one worksheet into a new workshe | Excel Discussion (Misc queries) | |||
how to auto save in exel 2003 | Excel Discussion (Misc queries) | |||
Restore the auto save function, it was a life saver. | Excel Discussion (Misc queries) |