View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
TT TT is offline
external usenet poster
 
Posts: 32
Default Alerts - how to cancel

Thanks very much for being so patient with me Dave. I do appreciate your
advice, and warning. and thank you for the solution. I know little about
macros, and I would need to educate myself on this.

I do hear your point, loud and clear. Once again. Thank you.

"Dave Peterson" wrote:

I do think of it as a safety feature and it would scare the heck out of me to
put something like this in one of my workbooks.

But if you really want, you can put this kind of code behind the ThisWorkbook
module:

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True
End Sub


Me refers to the workbook with the code. And me.saved=true just means that it's
code to tell excel that there's been a save and there are no outstanding changes
waiting to be saved.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

But (I'm repeating myself), I wouldn't do this.

TT wrote:

I know what you're saying, but that's my point. I do want to lose all my
changes. If I want to change, I'll click save, if not, I don't want to save
anything and don't want to be bothered with the alert double-checking for
me.....

But I guess it's a safe feature that I shouldn't really be getting rid
of.... thanks anyway.

"Dave Peterson" wrote:

There are usually ways to avoid any of these prompts. But each could have
disasterous results--imagine making tons of changes and closing. The workaround
would stop the alert and you'd lose your changes.

I surely wouldn't do it.

TT wrote:

I see. But if I close the file without clicking save, I won't be saving
anything anyway, correct? So I really don't need the alert since I'm not
saving any of the changes caused by volatile functions or events. Is my
thinking correct? So is there a way to get rid of the alert?

"Dave Peterson" wrote:

There are certain functions =now(), =today(), =indirect() (and others) that are
volatile. The update whether you make a change or not.

There could be worksheet/workbook/application events that could be firing that
change the workbook.

This is one of those warnings I'd try not to ignore.

TT wrote:

Everytime I open an excel file, flip through the different worksheets, didn't
make any change, and then exit, it always ask if I want to save changes.

Is there a way to cancel the alert? I want it so that if I close the file
without saving, that means I don't want to save anything I've done. I don't
need the alert. How do I take it out? Please help

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson