ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application.quit (https://www.excelbanter.com/excel-programming/385067-application-quit.html)

OlieH

Application.quit
 
Thanks for any help. I am running a macro that saves all workbooks and then
does application.quit. Excel opens and closes the VisualBasic window. Since
others will be using this macro, I wish to elimanate this opening/closing.
Thanks for the hlep.

Don Guillett

Application.quit
 

You should always post YOUR macro for comments. Try this

Sub CLOSE_ALL()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In Application.Workbooks
If w.Name < ThisWorkbook.Name Then
w.Save
w.Close
End If
Next w
ThisWorkbook.Save
Application.Quit
End Sub


--
Don Guillett
SalesAid Software

"OlieH" wrote in message
...
Thanks for any help. I am running a macro that saves all workbooks and
then
does application.quit. Excel opens and closes the VisualBasic window.
Since
others will be using this macro, I wish to elimanate this opening/closing.
Thanks for the hlep.




OlieH

Application.quit
 
Don, thanks for the help. Your macro worked for a couple of days but now the
Application.DisplayAlerts will not reset to False.
What have I done to cause this?

Thanks again for your help.
OlieH

"Don Guillett" wrote:


You should always post YOUR macro for comments. Try this

Sub CLOSE_ALL()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In Application.Workbooks
If w.Name < ThisWorkbook.Name Then
w.Save
w.Close
End If
Next w
ThisWorkbook.Save
Application.Quit
End Sub


--
Don Guillett
SalesAid Software

"OlieH" wrote in message
...
Thanks for any help. I am running a macro that saves all workbooks and
then
does application.quit. Excel opens and closes the VisualBasic window.
Since
others will be using this macro, I wish to elimanate this opening/closing.
Thanks for the hlep.





Don Guillett

Application.quit
 
I really can't think of anything but perhaps a before_close event in one of
your workbooks. Perhaps if you modify to move the line or close excel and
re-open. Last re-boot of computer?

Sub CLOSE_ALL()
Application.ScreenUpdating = False
For Each w In Application.Workbooks
If w.Name < ThisWorkbook.Name Then


Application.DisplayAlerts = False


w.Save
w.Close
End If
Next w
ThisWorkbook.Save
Application.Quit
End Sub



--
Don Guillett
SalesAid Software

"OlieH" wrote in message
...
Don, thanks for the help. Your macro worked for a couple of days but now
the
Application.DisplayAlerts will not reset to False.
What have I done to cause this?

Thanks again for your help.
OlieH

"Don Guillett" wrote:


You should always post YOUR macro for comments. Try this

Sub CLOSE_ALL()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In Application.Workbooks
If w.Name < ThisWorkbook.Name Then
w.Save
w.Close
End If
Next w
ThisWorkbook.Save
Application.Quit
End Sub


--
Don Guillett
SalesAid Software

"OlieH" wrote in message
...
Thanks for any help. I am running a macro that saves all workbooks and
then
does application.quit. Excel opens and closes the VisualBasic window.
Since
others will be using this macro, I wish to elimanate this
opening/closing.
Thanks for the hlep.








All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com