Link to home
Start Free TrialLog in
Avatar of vnunkoo
vnunkoo

asked on

Do you want to save changes you made to 'xxxx.xls'?

Hi,
When i close an excell document each time it prompts me "do you want to save changes you made to" even though no modification have been made.Pls help
Avatar of Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Flag of New Zealand image

Hello vnunkoo,

this can be caused by volatile formulas like

=now()
=today()

and many others, or by macros that force a re-calculation of the sheet, even if nothing has changed.

Look for volatile formulas, look for macros. Post the file (replacing confidential information with dummy data) if you can't find it.

cheers, teylyn
Avatar of vnunkoo
vnunkoo

ASKER

Hi teylyn,
when i remove the formulas it doesnt prompt me for the message. But i need these formulas. Is there an option to disable the msg. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
You can also use below code which needs to be placed into ThisWorkbook Object (Alt+F11).
Code will automaticaly save the file on close.



Private Sub Workbook_Beforeclose(Cancel As Boolean)

    Application.DisplayAlerts = False
    
    ThisWorkbook.Save

    Application.DisplayAlerts = True
    
End Sub

Open in new window

Msmax's suggestion effectively takes away the user's decision whether or not they want to save changes.

Any changes.

Regardless of whether the "changes" are just re-calculated formulas because the time/date is now different from the last time the workbook was opened, or whether the user actually changed any data manually.

I'm not to sure I'd want to change the workbook without notice, if, for example, the user has just accidentally deleted large parts of the data.  With MSmax's suggestion, the changes will be saved without asking for confirmation.

With the suggestion posted above, you do not have any control over whether to save or not. No matter what damage the user has done to the workbook, it will be save WITHOUT ANY WARNING.

Not a good idea.

cheers
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial