[RESOLVED] How VBA change to sheet in workbook on close, without question "Do you want to save"?
Hi.
In both Workbook_BeforeClose and Workbook_Open I need to change color index for some cells.
If the user have not made any changes to the sheet, except for those changes that where done in the BeforeClose and Open of the Workbook, I would prefer not to get the question "Do you want to save the changes you made to ...."
Is that possible? .. How
Re: How VBA change to sheet in workbook on close, without question "Do you want to save"?
Yes, two ways. One calll a .Save on the workbook to automatically save the book. If its the first time then it will prompt for a location. Or you could use the .SaveAs and supply the location and filename. Or not save at all and mark it as .Saved = True to fool Excel but your changes will be lost.
Re: How VBA change to sheet in workbook on close, without question "Do you want to sa
Thanks for the answer.
That sound like a good idea.
I could use:
Saved = True in workbook_open after my initial changes.
Then in Workbook_BeforeClose I could check if
the user has made any changes.
If he has not: then I could use: Saved = True
If he has then I would not use: Saved = True
So... How can I check if the workbook has been changed by the user?
Any suggestions?
Re: How VBA change to sheet in workbook on close, without question "Do you want to sa
Got it now:
I can use
ThisWorkbook.Saved = True
after my code in excel open
and check against that code before i make any changes in
Workbook_BeforeClose
if any changes have not been done then I use
ThisWorkbook.Saved = True after my changes in Workbook_BeforeClose
Works like a charm...
Thanks a lot !!!!
Re: How VBA change to sheet in workbook on close, without question "Do you want to save"?
Np, glad to help. :)
Ps, dont forget to 'Resolve' your thread so other members will know its solved. ;)