Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Clsong Excel

Hi,
' Save And Close
ActiveWindow.Close savechanges:=True

this closes and saves to workbook but leaves Excel still running, I want to
close Excel as well.

Any ideas

MarkS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Clsong Excel

Hi Mark,

Try:

Application.Quit


---
Regards,
Norman


"MarkS" wrote in message
...
Hi,
' Save And Close
ActiveWindow.Close savechanges:=True

this closes and saves to workbook but leaves Excel still running, I want
to
close Excel as well.

Any ideas

MarkS



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Clsong Excel

Mark,
For your information your code does not necessarily close and save the
workbook.
If the workbook only has a single window, then it does as you expect,
otherwise it only closes the activewindow.

You should use one of these, depending on the location of the code and what
you requi
ActiveWorkbook.Close True
ThisWorkbook.Close True
Workbooks(1).Close True
Workbooks("Somename.xls").Close True

As for closing Excel
Application.Quit

although you may get prompted it other WBs are open/changes made.

NickHK

"MarkS" wrote in message
...
Hi,
' Save And Close
ActiveWindow.Close savechanges:=True

this closes and saves to workbook but leaves Excel still running, I want

to
close Excel as well.

Any ideas

MarkS



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Clsong Excel

Hi,
Not quit what I wanted but this does work

ThisWorkbook.Save
Application.Quit


"NickHK" wrote:

Mark,
For your information your code does not necessarily close and save the
workbook.
If the workbook only has a single window, then it does as you expect,
otherwise it only closes the activewindow.

You should use one of these, depending on the location of the code and what
you requi
ActiveWorkbook.Close True
ThisWorkbook.Close True
Workbooks(1).Close True
Workbooks("Somename.xls").Close True

As for closing Excel
Application.Quit

although you may get prompted it other WBs are open/changes made.

NickHK

"MarkS" wrote in message
...
Hi,
' Save And Close
ActiveWindow.Close savechanges:=True

this closes and saves to workbook but leaves Excel still running, I want

to
close Excel as well.

Any ideas

MarkS




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



All times are GMT +1. The time now is 04:02 PM.

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"