|
-
Oct 27th, 2005, 03:24 AM
#1
[RESOLVED] Excel: eliminate warning about saving changes?
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?.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Oct 27th, 2005, 07:07 AM
#2
Re: Excel: eliminate warning about saving changes?
I think something like this would work
VB Code:
xl.Application.DisplayAlerts = False
-
Oct 27th, 2005, 07:23 AM
#3
Re: Excel: eliminate warning about saving changes?
 Originally Posted by Hack
I think something like this would work
VB Code:
xl.Application.DisplayAlerts = False
It didn't work. Am I doing it right?
VB Code:
Private Sub Workbook_Open()
Application.DisplayAlerts = False
End Sub
I tried to place it in the procedures Workbook_Deactivate and Workbook_BeforeClose as well to no avail.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Oct 27th, 2005, 08:36 AM
#4
Re: Excel: eliminate warning about saving changes?
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
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Oct 27th, 2005, 11:51 AM
#5
Re: Excel: eliminate warning about saving changes?
If you mark the workbook as already being saved then when its closed it wont prompt you to save it. This will work.
VB Code:
Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Saved = True
End Sub
Moved from General PC forum.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 27th, 2005, 11:56 AM
#6
Re: Excel: eliminate warning about saving changes?
 Originally Posted by RobDog888
[color=navy]Moved from General PC forum.
Thank you sir! 
Nice little tip as well! 
BTW: In Access, to accomplish this you would do
VB Code:
Axs.DoCmd.SetWarnings = False
Is there a handy dandy way of fooling Access as you have demonstrated can be done with Excel?
-
Oct 28th, 2005, 01:21 AM
#7
Re: Excel: eliminate warning about saving changes?
 Originally Posted by RobDog888
If you mark the workbook as already being saved then when its closed it wont prompt you to save it. This will work.
VB Code:
Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Saved = True
End Sub
Moved from General PC forum.
Oh yes, sir, it does work! Thanks a lot. And btw I hadn't even noticed there was an Office Development Forum
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|