#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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!


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default 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!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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!





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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!





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default 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!









  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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!









  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 230
Default 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!











  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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!













  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 230
Default 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!















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
Saving dpal Excel Worksheet Functions 1 December 14th 06 06:45 PM
Saving help Murhfeeh56 Excel Discussion (Misc queries) 0 June 21st 06 12:10 AM
Saving Gazza at emaths Excel Discussion (Misc queries) 1 May 4th 06 12:33 AM
saving to CD agilitygrandma Excel Discussion (Misc queries) 8 January 20th 06 08:24 PM
Saving and DRM LDanix Excel Discussion (Misc queries) 1 January 13th 05 07:13 PM


All times are GMT +1. The time now is 10:38 PM.

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"