Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Completely Exit Excel Macro

How do I get Excel to actually completely exit? Below is the code I'm trying
to use but when it gets to the close portion, it only closes the workbook and
Excel is still running/opened.

DoFinishing = MsgBox("All Done With Updates... Save Spreadsheet and
Exit?", vbYesNo)
If DoFinishing = vbNo Then
DoSave = MsgBox("Then Do You Want To Save The Spreadsheet?", vbYesNo)
If DoSave = vbNo Then
Exit Sub
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.DisplayAlerts = True
Exit Sub
End If
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.Workbooks("! Compiled.xls").Close
Application.DisplayAlerts = True
End If

Thanks,
R
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Completely Exit Excel Macro

Try:

Application.Quit

at the very end.

Hope this helps.

Pete

On Jul 12, 11:16 pm, Rob wrote:
How do I get Excel to actually completely exit? Below is the code I'm trying
to use but when it gets to the close portion, it only closes the workbook and
Excel is still running/opened.

DoFinishing = MsgBox("All Done With Updates... Save Spreadsheet and
Exit?", vbYesNo)
If DoFinishing = vbNo Then
DoSave = MsgBox("Then Do You Want To Save The Spreadsheet?", vbYesNo)
If DoSave = vbNo Then
Exit Sub
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.DisplayAlerts = True
Exit Sub
End If
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.Workbooks("! Compiled.xls").Close
Application.DisplayAlerts = True
End If

Thanks,
R



  #3   Report Post  
Posted to microsoft.public.excel.misc
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Completely Exit Excel Macro

Absolutely Wonderful. So simple I feel stupid.

Thanks Much,
R



"Pete_UK" wrote:

Try:

Application.Quit

at the very end.

Hope this helps.

Pete

On Jul 12, 11:16 pm, Rob wrote:
How do I get Excel to actually completely exit? Below is the code I'm trying
to use but when it gets to the close portion, it only closes the workbook and
Excel is still running/opened.

DoFinishing = MsgBox("All Done With Updates... Save Spreadsheet and
Exit?", vbYesNo)
If DoFinishing = vbNo Then
DoSave = MsgBox("Then Do You Want To Save The Spreadsheet?", vbYesNo)
If DoSave = vbNo Then
Exit Sub
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.DisplayAlerts = True
Exit Sub
End If
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.Workbooks("! Compiled.xls").Close
Application.DisplayAlerts = True
End If

Thanks,
R




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Completely Exit Excel Macro

You're welcome - thanks for feeding back.

Pete

On Jul 13, 12:32 pm, Rob wrote:
Absolutely Wonderful. So simple I feel stupid.

Thanks Much,
R



"Pete_UK" wrote:
Try:


Application.Quit


at the very end.


Hope this helps.


Pete


On Jul 12, 11:16 pm, Rob wrote:
How do I get Excel to actually completely exit? Below is the code I'm trying
to use but when it gets to the close portion, it only closes the workbook and
Excel is still running/opened.


DoFinishing = MsgBox("All Done With Updates... Save Spreadsheet and
Exit?", vbYesNo)
If DoFinishing = vbNo Then
DoSave = MsgBox("Then Do You Want To Save The Spreadsheet?", vbYesNo)
If DoSave = vbNo Then
Exit Sub
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.DisplayAlerts = True
Exit Sub
End If
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.Workbooks("! Compiled.xls").Close
Application.DisplayAlerts = True
End If


Thanks,
R- Hide quoted text -


- Show quoted text -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting a macro completely sgreene Excel Discussion (Misc queries) 2 October 19th 06 05:37 PM
macro wants to exit excel curlydave Excel Discussion (Misc queries) 3 July 2nd 06 04:19 PM
Exit via macro only? Brisbane Rob Excel Discussion (Misc queries) 1 October 13th 05 01:16 PM
on exit macro ditchy Excel Discussion (Misc queries) 2 May 3rd 05 12:11 AM
How do i create a command button or macro to exit Microsoft Excel raj Excel Worksheet Functions 1 April 30th 05 02:17 PM


All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"