View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] jeff.j.griffith@gmail.com is offline
external usenet poster
 
Posts: 22
Default exit from excel?

Try:

Application.Quit


Mark J wrote:
how do i exit out of excel after running following code?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Worksheets("WEDPg1").Select
Application.Run ("HistClient.xla!mnuConvertSheet")
Worksheets("WEDPg2").Select
Application.Run ("HistClient.xla!mnuConvertSheet")
Worksheets("WEDPg3").Select
Application.Run ("HistClient.xla!mnuConvertSheet")
Worksheets("WEDPg4").Select
Application.Run ("HistClient.xla!mnuConvertSheet")
Worksheets("WEDPg5").Select
Application.Run ("HistClient.xla!mnuConvertSheet")
Worksheets("WEDPg6").Select
Application.Run ("HistClient.xla!mnuConvertSheet")
Worksheets("WEDPg7").Select
Application.Run ("HistClient.xla!mnuConvertSheet")


DDate = Format(Now() - 1, "mmddyyyy")
ActiveWorkbook.SaveAs Filename:="" & DDate & ".xls"
ActiveWorkbook.Close