Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excelfile wants to save before closing
Hi all
I have a File which always asks me to Save before I close, even if I have saved it 2 seconds before. Is there a possibility to tell excel that it doesn't need to ask? Can I just set the Displayalerts to false before closing? I'm afraid that it would save this state and the next time I open Excel Displayalerts would still be on false. Any help is appreciated Thanks in advance Carlo |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excelfile wants to save before closing
You can set displayalerts=false in the before close dialog and Excel won't
remeber this the next time it is opened but this is risky becuase if there is a genuine need to save before closing the macro will run again and you won't be alerted. It is far more likely that something is actually changing in the workbook. You could try and detect changes you are unaware of by putting something in the sheet acahnge macro temporarilly. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) msg = "I've changed" MsgBox (msg) End Sub This will alert you and maybe help you track changes you are unaware of. "Carlo" wrote: Hi all I have a File which always asks me to Save before I close, even if I have saved it 2 seconds before. Is there a possibility to tell excel that it doesn't need to ask? Can I just set the Displayalerts to false before closing? I'm afraid that it would save this state and the next time I open Excel Displayalerts would still be on false. Any help is appreciated Thanks in advance Carlo |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excelfile wants to save before closing
Mike
That is a good solution, may I just recommend that Carlo put the following in the message box: Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) MsgBox "Changed at '" & Target.address & " on '" & _ sh.name & "'.", vbokonly,"Change" End Sub It may make it easier to pickup. -- Hope this helps Martin Fishlock, Bangkok, Thailand Please do not forget to rate this reply. "Mike" wrote: You can set displayalerts=false in the before close dialog and Excel won't remeber this the next time it is opened but this is risky becuase if there is a genuine need to save before closing the macro will run again and you won't be alerted. It is far more likely that something is actually changing in the workbook. You could try and detect changes you are unaware of by putting something in the sheet acahnge macro temporarilly. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) msg = "I've changed" MsgBox (msg) End Sub This will alert you and maybe help you track changes you are unaware of. "Carlo" wrote: Hi all I have a File which always asks me to Save before I close, even if I have saved it 2 seconds before. Is there a possibility to tell excel that it doesn't need to ask? Can I just set the Displayalerts to false before closing? I'm afraid that it would save this state and the next time I open Excel Displayalerts would still be on false. Any help is appreciated Thanks in advance Carlo |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excelfile wants to save before closing
Hi Mike
thanks a lot for your answer. I'm going to do it with the displayalert, but I'm going to query if a certain cell has the right state. If it has, nothing needs to be changed. So I can live with that. But nevertheless i'm going to try and find out what changes, I'm quite sure it is a Worksheet Function I wrote which gets triggered after Save. But I'm having a look at this. Thanks a lot for your quick answer Carlo "Mike" wrote: You can set displayalerts=false in the before close dialog and Excel won't remeber this the next time it is opened but this is risky becuase if there is a genuine need to save before closing the macro will run again and you won't be alerted. It is far more likely that something is actually changing in the workbook. You could try and detect changes you are unaware of by putting something in the sheet acahnge macro temporarilly. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) msg = "I've changed" MsgBox (msg) End Sub This will alert you and maybe help you track changes you are unaware of. "Carlo" wrote: Hi all I have a File which always asks me to Save before I close, even if I have saved it 2 seconds before. Is there a possibility to tell excel that it doesn't need to ask? Can I just set the Displayalerts to false before closing? I'm afraid that it would save this state and the next time I open Excel Displayalerts would still be on false. Any help is appreciated Thanks in advance Carlo |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excelfile wants to save before closing
Hi Guys
first of all thx Martin for the addition. secondly, if I write these lines: Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.DisplayAlerts = False End Sub Excel still asks me if I want to save!!? What do I do wrong? Thanks for any answer Carlo "Mike" wrote: You can set displayalerts=false in the before close dialog and Excel won't remeber this the next time it is opened but this is risky becuase if there is a genuine need to save before closing the macro will run again and you won't be alerted. It is far more likely that something is actually changing in the workbook. You could try and detect changes you are unaware of by putting something in the sheet acahnge macro temporarilly. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) msg = "I've changed" MsgBox (msg) End Sub This will alert you and maybe help you track changes you are unaware of. "Carlo" wrote: Hi all I have a File which always asks me to Save before I close, even if I have saved it 2 seconds before. Is there a possibility to tell excel that it doesn't need to ask? Can I just set the Displayalerts to false before closing? I'm afraid that it would save this state and the next time I open Excel Displayalerts would still be on false. Any help is appreciated Thanks in advance Carlo |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excelfile wants to save before closing
What I just found out:
If I debug the value of displayalerts it is always true, I can't change it in the beforeclose sub, could that be?? Carlo "Mike" wrote: You can set displayalerts=false in the before close dialog and Excel won't remeber this the next time it is opened but this is risky becuase if there is a genuine need to save before closing the macro will run again and you won't be alerted. It is far more likely that something is actually changing in the workbook. You could try and detect changes you are unaware of by putting something in the sheet acahnge macro temporarilly. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) msg = "I've changed" MsgBox (msg) End Sub This will alert you and maybe help you track changes you are unaware of. "Carlo" wrote: Hi all I have a File which always asks me to Save before I close, even if I have saved it 2 seconds before. Is there a possibility to tell excel that it doesn't need to ask? Can I just set the Displayalerts to false before closing? I'm afraid that it would save this state and the next time I open Excel Displayalerts would still be on false. Any help is appreciated Thanks in advance Carlo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Save files before closing | Excel Discussion (Misc queries) | |||
Prompt for Save when closing a file | Excel Discussion (Misc queries) | |||
Auto Save on closing | Excel Discussion (Misc queries) | |||
how to disable save prompt on closing excel file in automated mode | Excel Discussion (Misc queries) | |||
Save? prompt when closing Excel | Excel Discussion (Misc queries) |