Saving
I have a small program called 'Notebook' that when I close it, it saves
automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
Saving
Put this in Personal.xls
Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application 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 (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... I have a small program called 'Notebook' that when I close it, it saves automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
Saving
Where exactly is the 'Excel icon on the worksheet'?
"Bob Phillips" wrote in message ... Put this in Personal.xls Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application 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 (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... I have a small program called 'Notebook' that when I close it, it saves automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
Saving
If workbook window is maximized the Excel Icon will be left of "File" on the
menubar. If not maximized, will be at left end of title bar. Gord Dibben MS Excel MVP On Fri, 7 Dec 2007 23:21:13 +0100, "eman" wrote: Where exactly is the 'Excel icon on the worksheet'? "Bob Phillips" wrote in message ... Put this in Personal.xls Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application 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 (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... I have a small program called 'Notebook' that when I close it, it saves automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
Saving
Uh, the Excel icon?
It is the Excel image at the top left of the worksheet next to the worksheet name. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... Where exactly is the 'Excel icon on the worksheet'? "Bob Phillips" wrote in message ... Put this in Personal.xls Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application 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 (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... I have a small program called 'Notebook' that when I close it, it saves automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
Saving
I can't see any 'View Code' in that menu! What I can see is: new, open,
convert, save, save as, print, prepare, send, publish and close! "Bob Phillips" wrote in message ... Uh, the Excel icon? It is the Excel image at the top left of the worksheet next to the worksheet name. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... Where exactly is the 'Excel icon on the worksheet'? "Bob Phillips" wrote in message ... Put this in Personal.xls Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application 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 (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... I have a small program called 'Notebook' that when I close it, it saves automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
Saving
Maybe you're using version 2007?
Just right click the sheet tab and select View Code, then double click ThisWorkbook, and paste the code there-in. Rob "eman" wrote in message ... I can't see any 'View Code' in that menu! What I can see is: new, open, convert, save, save as, print, prepare, send, publish and close! "Bob Phillips" wrote in message ... Uh, the Excel icon? It is the Excel image at the top left of the worksheet next to the worksheet name. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... Where exactly is the 'Excel icon on the worksheet'? "Bob Phillips" wrote in message ... Put this in Personal.xls Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application 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 (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... I have a small program called 'Notebook' that when I close it, it saves automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
Saving
Yes I am using 2007.
I pasted the code but still it isn't saving, it is still asking me if I want to save as before! When pasting the code do I have to save or something? "RobN" wrote in message ... Maybe you're using version 2007? Just right click the sheet tab and select View Code, then double click ThisWorkbook, and paste the code there-in. Rob "eman" wrote in message ... I can't see any 'View Code' in that menu! What I can see is: new, open, convert, save, save as, print, prepare, send, publish and close! "Bob Phillips" wrote in message ... Uh, the Excel icon? It is the Excel image at the top left of the worksheet next to the worksheet name. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... Where exactly is the 'Excel icon on the worksheet'? "Bob Phillips" wrote in message ... Put this in Personal.xls Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application 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 (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... I have a small program called 'Notebook' that when I close it, it saves automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
Saving
Did you paste this whole section? (Make sure there are no line
breaks....that is, don't have any red lines showing once pasted!). If you do have some red lines, it is best to maximise this window before you copy the code. Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application End Sub It works fine when I tried it. Maybe you didn't save the work book first as an .xlsm file (ie macro enabled)? Rob "eman" wrote in message ... Yes I am using 2007. I pasted the code but still it isn't saving, it is still asking me if I want to save as before! When pasting the code do I have to save or something? "RobN" wrote in message ... Maybe you're using version 2007? Just right click the sheet tab and select View Code, then double click ThisWorkbook, and paste the code there-in. Rob "eman" wrote in message ... I can't see any 'View Code' in that menu! What I can see is: new, open, convert, save, save as, print, prepare, send, publish and close! "Bob Phillips" wrote in message ... Uh, the Excel icon? It is the Excel image at the top left of the worksheet next to the worksheet name. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... Where exactly is the 'Excel icon on the worksheet'? "Bob Phillips" wrote in message ... Put this in Personal.xls Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Wb.Save End Sub Private Sub Workbook_Open() Set App = Application 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 (there's no email, no snail mail, but somewhere should be gmail in my addy) "eman" wrote in message ... I have a small program called 'Notebook' that when I close it, it saves automatically without selecting File/Save as. Is it possible to make this in Excel? I mean closing Excel without selecting save as each time but it saves automatically on closing! |
All times are GMT +1. The time now is 06:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com