Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier
 
Posts: n/a
Default 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
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
save a worksheet Caveman Excel Discussion (Misc queries) 2 December 11th 05 08:28 PM
Comparing a list to a Calendar worksheet. PatrickL Excel Worksheet Functions 0 August 25th 05 04:21 PM
How can I create a button to save one worksheet into a new workshe court Excel Discussion (Misc queries) 2 July 6th 05 06:39 PM
how to auto save in exel 2003 fotune Excel Discussion (Misc queries) 1 May 20th 05 01:48 PM
Restore the auto save function, it was a life saver. JJB Excel Discussion (Misc queries) 1 May 20th 05 01:25 PM


All times are GMT +1. The time now is 01:23 AM.

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"