A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

autosave function



 
 
Thread Tools Display Modes
  #1  
Old November 14th, 2006, 01:54 AM posted to microsoft.public.excel.setup
AdinaC
external usenet poster
 
Posts: 6
Default autosave function

Hello. I am setting up a worksheet that i need to allow others to access. I
have to be able to guarantee that the data they add is saved. I want to
create an autosave feature so that if the user does not save the document on
their own, it will save automatically when they close it. I have Excel 2003,
and have tried following some of the other people's questions about
downloading add in's from previous versions, but I don't get it. Having
Excel autosave every ... minutes doesn't help because I need to be able to
guarantee that any added data is saved before - or when - closing.

Thanks,

Adina
  #2  
Old November 14th, 2006, 10:16 AM posted to microsoft.public.excel.setup
Bob Phillips
external usenet poster
 
Posts: 1,032
Default autosave function

You don't need an add-in for this, just add this code to the workbook

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"AdinaC" wrote in message
...
Hello. I am setting up a worksheet that i need to allow others to access.

I
have to be able to guarantee that the data they add is saved. I want to
create an autosave feature so that if the user does not save the document

on
their own, it will save automatically when they close it. I have Excel

2003,
and have tried following some of the other people's questions about
downloading add in's from previous versions, but I don't get it. Having
Excel autosave every ... minutes doesn't help because I need to be able to
guarantee that any added data is saved before - or when - closing.

Thanks,

Adina



  #3  
Old November 16th, 2006, 12:02 AM posted to microsoft.public.excel.setup
AdinaC
external usenet poster
 
Posts: 6
Default autosave function

Hi Bob,

Thank you for helping me. I did what you said, right click on Excel icon,
choose view code, but there is no where to paste. All I get is a greyed-out
screen with a few edit icons. Where do I paste?

Thanks,

Adina

"Bob Phillips" wrote:

You don't need an add-in for this, just add this code to the workbook

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"AdinaC" wrote in message
...
Hello. I am setting up a worksheet that i need to allow others to access.

I
have to be able to guarantee that the data they add is saved. I want to
create an autosave feature so that if the user does not save the document

on
their own, it will save automatically when they close it. I have Excel

2003,
and have tried following some of the other people's questions about
downloading add in's from previous versions, but I don't get it. Having
Excel autosave every ... minutes doesn't help because I need to be able to
guarantee that any added data is saved before - or when - closing.

Thanks,

Adina




  #4  
Old November 16th, 2006, 09:36 AM posted to microsoft.public.excel.setup
Bob Phillips
external usenet poster
 
Posts: 1,032
Default autosave function

Make sure that the ThisWorkbook code module is showing, double-click the
item in the explorer pane if not.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"AdinaC" wrote in message
...
Hi Bob,

Thank you for helping me. I did what you said, right click on Excel icon,
choose view code, but there is no where to paste. All I get is a

greyed-out
screen with a few edit icons. Where do I paste?

Thanks,

Adina

"Bob Phillips" wrote:

You don't need an add-in for this, just add this code to the workbook

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"AdinaC" wrote in message
...
Hello. I am setting up a worksheet that i need to allow others to

access.
I
have to be able to guarantee that the data they add is saved. I want

to
create an autosave feature so that if the user does not save the

document
on
their own, it will save automatically when they close it. I have

Excel
2003,
and have tried following some of the other people's questions about
downloading add in's from previous versions, but I don't get it.

Having
Excel autosave every ... minutes doesn't help because I need to be

able to
guarantee that any added data is saved before - or when - closing.

Thanks,

Adina






  #5  
Old November 17th, 2006, 07:52 PM posted to microsoft.public.excel.setup
AdinaC
external usenet poster
 
Posts: 6
Default autosave function

Hi Bob,

You are the BEST!!!!! I couldn't paste the macro the first time. When I
tried to go into visual basic, it told me I didn't have enough memory.. I
thought it was just my computer, so we pasted your macro on another computer
and it worked. When I tried to open the shared file on my computer, that is
when Excel told me to change the security. Apparently it was set to high.
Now I have it on medium so I can choose whether or not to use the macro, and
it works great. We tested it, and it saved the data and didn't even require
the user to choose "yes" or anything. It just saved it without you knowing
and then when I opened it back up, there was the data. Thanks again, you are
the best!!

Adina

"Bob Phillips" wrote:

Make sure that the ThisWorkbook code module is showing, double-click the
item in the explorer pane if not.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"AdinaC" wrote in message
...
Hi Bob,

Thank you for helping me. I did what you said, right click on Excel icon,
choose view code, but there is no where to paste. All I get is a

greyed-out
screen with a few edit icons. Where do I paste?

Thanks,

Adina

"Bob Phillips" wrote:

You don't need an add-in for this, just add this code to the workbook

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"AdinaC" wrote in message
...
Hello. I am setting up a worksheet that i need to allow others to

access.
I
have to be able to guarantee that the data they add is saved. I want

to
create an autosave feature so that if the user does not save the

document
on
their own, it will save automatically when they close it. I have

Excel
2003,
and have tried following some of the other people's questions about
downloading add in's from previous versions, but I don't get it.

Having
Excel autosave every ... minutes doesn't help because I need to be

able to
guarantee that any added data is saved before - or when - closing.

Thanks,

Adina






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:45 AM.


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