![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 42
|
Please, what code do I need to put in to make sure that any changes made to a sheet are automatically svaed without throwing up the do you want to save changes box?
I assume within the this workbook part I add a subroutine called sub workbook_close() then put some code in there. I tried workbook.close savechanges=true but this did not work savechanges = true on its own did not work either. Is workbook_close()an acceptable routine, will it run automatically on close or should it be something like autoclose? Any help much appreciated Andy |
|
|
|
|
|
#2 |
|
New Member
Join Date: Feb 2002
Location: Louisiana USA
Posts: 26
|
I'm sure not an expert but you could put a button on the worksheet, name it Exit whatever, go into the button properties and take the check out of print object. Go to the view code on the button and paste in
Private Sub CommandButton1_Click() ActiveWorkbook.Save Application.Quit End Sub |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Georgia USA
Posts: 544
|
Private Sub Workbook_BeforeClose(Cancel As Boolean) ActiveWorkbook.Save End Sub |
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Posts: 11
|
Hi,
try to close all the alters when start excel excelApp.DisplayAlerts = False then save your workbook before close it. sourceWB.SaveAs filePath$ sourceWB.Close dan |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|