Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 179
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 179
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 179
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 179
Default 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
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
Save files before closing MasterP Excel Discussion (Misc queries) 1 December 30th 05 08:13 PM
Prompt for Save when closing a file J. Kerr Excel Discussion (Misc queries) 0 October 5th 05 09:09 PM
Auto Save on closing AJM1949 Excel Discussion (Misc queries) 3 September 21st 05 10:03 AM
how to disable save prompt on closing excel file in automated mode [email protected] Excel Discussion (Misc queries) 3 July 6th 05 10:35 PM
Save? prompt when closing Excel MC Excel Discussion (Misc queries) 4 March 12th 05 10:55 PM


All times are GMT +1. The time now is 03:45 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"