![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: Mar 2002
Location: Easton,PA USA
Posts: 3
|
XL2000user:
I would to use a macro to close its workbook and then shut down XL. The script below is what I was trying. Each statement runs by itself, but together the macro stops after the worksheet closes. The ap does not shut down. ??? Todd |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
Don't try and close the workbook first, use a statement to save it if necessary and then just use: -
Application.Quit |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
Quote:
but, you might try putting the: Application.Quit in the Workbook_BeforeClose i.e: Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.Quit End Sub Any help?
__________________
"Have a good time......all the time" Ian Mac |
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Location: Easton,PA USA
Posts: 3
|
This is the script I was supposed to attach
Private Sub Workbook_Open() Call Import '(macro name) Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.Quit End Sub |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Quit End Sub works for me??
__________________
"Have a good time......all the time" Ian Mac |
|
|
|
|
|
#6 | |
|
New Member
Join Date: Mar 2002
Location: Easton,PA USA
Posts: 3
|
Quote:
Private Sub Workbook_Open() Call Import Me.Close SaveChanges = False Application.Quit End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.Quit End Sub |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|