Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Nicole Hughes   on Oct 26 In MS Office Category.

  
Question Answered By: Camille Garrett   on Oct 26

I don't think it has anything to do with speed / busy. I don't think
Application.Quit is supposed to have immediate effect. For instance, the
following code  from Microsoft

Sub QuitMSExcel()

'Loop through all open workbooks.
For Each xWkbk In Workbooks

'If the active workbook does not contain this macro, its name is
'different. If this is the case, then
If xWkbk.Name <> ThisWorkbook.Name Then

'Close the workbook and save changes. Note that you
'don't have to save changes if you don't want to. Closing
'the workbook through this code, prevents the Auto_Close
'macros from running.
xWkbk.Close SaveChanges:=True

End If

'Loop to the next workbook. When all workbooks except for this
'workbook are closed, exit the loop.
Next xWkbk

'Quit Microsoft Excel.
Application.Quit

'This line makes sure that an Auto_Close macro in this workbook
'does not run, if it exists.
ThisWorkbook.Close SaveChanges:=True

End Sub

shows a workbook close after the Application.Quit. The Microsoft programmer
clearly expects this to run  before the quit actually happens.

I'd suggest that Application.Quit simply queues the quit command  for action
next time the application  goes inactive.

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on application.quit - code continues to run Or get search suggestion and latest updates.


Tagged: