I have an Excel spreadsheet in a web site. It is write-protected but changes are automatically made because of date/time-related functions. Is it possible to configurate it such that it won't ask about saving changes when it is closed?.
Printable View
I have an Excel spreadsheet in a web site. It is write-protected but changes are automatically made because of date/time-related functions. Is it possible to configurate it such that it won't ask about saving changes when it is closed?.
I think something like this would workVB Code:
xl.Application.DisplayAlerts = False
It didn't work. Am I doing it right?Quote:
Originally Posted by Hack
I tried to place it in the procedures Workbook_Deactivate and Workbook_BeforeClose as well to no avail.VB Code:
Private Sub Workbook_Open() Application.DisplayAlerts = False End Sub
For now I can make do with this, though it's not too elegant -kind of makes me feel like I'm cheating :)
VB Code:
Sub Workbook_BeforeClose() SendKeys vbTab SendKeys vbCr End Sub
If you mark the workbook as already being saved then when its closed it wont prompt you to save it. This will work.
Moved from General PC forum.VB Code:
Sub Workbook_BeforeClose(Cancel As Boolean) ActiveWorkbook.Saved = True End Sub
Thank you sir! :thumb:Quote:
Originally Posted by RobDog888
Nice little tip as well! :)
BTW: In Access, to accomplish this you would doIs there a handy dandy way of fooling Access as you have demonstrated can be done with Excel?VB Code:
Axs.DoCmd.SetWarnings = False
Oh yes, sir, it does work! Thanks a lot. And btw I hadn't even noticed there was an Office Development Forum :blush:Quote:
Originally Posted by RobDog888