![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
|
Is there anyway, from a macro, that I can close the active workbook and exit excel??
|
|
|
|
|
|
#2 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
Application.Quit
But if you have unsaved documents then you will be prompted. To avoid it and close workbooks without saving: '------CODE START----- Dim wrkBook As Workbook For Each wrkBook In Workbooks wrkBook.Saved = True Next Application.Quit '------CODE END----- or save all workbooks '------CODE START----- Dim wrkBook As Workbook For Each wrkBook In Workbooks wrkBook.Save Next Application.Quit '------CODE END----- regards |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|