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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|