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

Application.Quit closes Excel. Is there an equivalent that
just closes the Workbook ?

Thanks - Kirk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Application.Quit

Hi,

Activeworkbook.close

You may be prompted to save changes and if you don't want that use

Application.displayalerts=false

or you can save automatically

ActiveWorkbook.Close savechanges:=True

Mike


"kirkm" wrote:

Application.Quit closes Excel. Is there an equivalent that
just closes the Workbook ?

Thanks - Kirk

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Application.Quit

On Fri, 17 Oct 2008 00:55:00 -0700, Mike H
wrote:

Hi,

Activeworkbook.close


Thanks Mike, that did work but had an odd side effect.

If I open the workbook again, none of the double click events
work. (Until I close and Open Excel again).

These usually fire 'Private Sub Worksheet_BeforeDoubleClick'.
but this is completly bypassed somehow.

I wonder why, any idea?

Thanks - Kirk
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Application.Quit

On Fri, 17 Oct 2008 00:55:00 -0700, Mike H
wrote:

Hi,

Activeworkbook.close


Thanks Mike, that did work but had an odd side effect.

If I open the workbook again, none of the double click events
work. (Until I close and Open Excel again).

These usually fire 'Private Sub Worksheet_BeforeDoubleClick'.
but this is completly bypassed somehow.

I wonder why, any idea?

Thanks - Kirk
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Application.Quit

It sounds like your disabling events somewhere when you close this book and
they remain disabled until the application is closed and re-opened. I suspect
you have other code somwhere in this book.

Mike

"kirkm" wrote:

On Fri, 17 Oct 2008 00:55:00 -0700, Mike H
wrote:

Hi,

Activeworkbook.close


Thanks Mike, that did work but had an odd side effect.

If I open the workbook again, none of the double click events
work. (Until I close and Open Excel again).

These usually fire 'Private Sub Worksheet_BeforeDoubleClick'.
but this is completly bypassed somehow.

I wonder why, any idea?

Thanks - Kirk



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Application.Quit

The example you gave with turning display alerts off may have been used; use
the activeworkbook.close savechanges:=true example instead. Take out the
application.displayalerts=false line. You can also use ThisWorkbook instead
of ActiveWorkbook to narrow it down to the workbook containing the macro.
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Mike H" wrote:

It sounds like your disabling events somewhere when you close this book and
they remain disabled until the application is closed and re-opened. I suspect
you have other code somwhere in this book.

Mike

"kirkm" wrote:

On Fri, 17 Oct 2008 00:55:00 -0700, Mike H
wrote:

Hi,

Activeworkbook.close


Thanks Mike, that did work but had an odd side effect.

If I open the workbook again, none of the double click events
work. (Until I close and Open Excel again).

These usually fire 'Private Sub Worksheet_BeforeDoubleClick'.
but this is completly bypassed somehow.

I wonder why, any idea?

Thanks - Kirk

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Application.Quit

Stopping display alerts will have no impact on events

"Orion Cochrane" wrote:

The example you gave with turning display alerts off may have been used; use
the activeworkbook.close savechanges:=true example instead. Take out the
application.displayalerts=false line. You can also use ThisWorkbook instead
of ActiveWorkbook to narrow it down to the workbook containing the macro.
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Mike H" wrote:

It sounds like your disabling events somewhere when you close this book and
they remain disabled until the application is closed and re-opened. I suspect
you have other code somwhere in this book.

Mike

"kirkm" wrote:

On Fri, 17 Oct 2008 00:55:00 -0700, Mike H
wrote:

Hi,

Activeworkbook.close

Thanks Mike, that did work but had an odd side effect.

If I open the workbook again, none of the double click events
work. (Until I close and Open Excel again).

These usually fire 'Private Sub Worksheet_BeforeDoubleClick'.
but this is completly bypassed somehow.

I wonder why, any idea?

Thanks - Kirk

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
Application.Quit Does not Close the Application [email protected] Excel Programming 6 October 8th 09 10:32 PM
Application.quit OlieH Excel Programming 3 March 15th 07 12:26 PM
difference application.quit & application.close Pierre via OfficeKB.com[_2_] Excel Programming 4 November 8th 05 07:55 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
application.quit will not shut off application john Excel Programming 0 January 9th 04 11:29 PM


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

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

About Us

"It's about Microsoft Excel"