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

I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Thanks

G

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default Application.Quit

Hi

Application.DisplayAlerts = False

--
Regards

Roger Govier


"elcroco" wrote in message
ups.com...
I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Thanks

G



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

Hi,

I forgot in my first message the Application.DisplayAlerts = False I
have set in my procedure
It doesn't work because the "Save" dialog box is not an alert

G


Roger Govier a écrit :

Hi

Application.DisplayAlerts = False

--
Regards

Roger Govier


"elcroco" wrote in message
ups.com...
I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Thanks

G


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Application.Quit

Maybe try

Activeworkbook.Close Savechanges:=False

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"elcroco" wrote in message
ups.com...
Hi,

I forgot in my first message the Application.DisplayAlerts = False I
have set in my procedure
It doesn't work because the "Save" dialog box is not an alert

G


Roger Govier a écrit :

Hi

Application.DisplayAlerts = False

--
Regards

Roger Govier


"elcroco" wrote in message
ups.com...
I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Thanks

G



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

elcroco wrote:
I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Areyou sure that the user won't have another file open and lose work in
that?

You could set thisworkbook.saved = true, which will tell Excel that
there are no chanegs to save. If there is only one workbook open, Excel
will quit; if there is another workbook the user will be prompted to
save changes if there are any.

Nik


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

Bob, I m not sure that your proposal answers properly to my question,
because this line of code close the workbook but not excel


Bob Phillips a écrit :

Maybe try

Activeworkbook.Close Savechanges:=False

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"elcroco" wrote in message
ups.com...
Hi,

I forgot in my first message the Application.DisplayAlerts = False I
have set in my procedure
It doesn't work because the "Save" dialog box is not an alert

G


Roger Govier a écrit :

Hi

Application.DisplayAlerts = False

--
Regards

Roger Govier


"elcroco" wrote in message
ups.com...
I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Thanks

G


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

Nik,

I consider that there's only one workbook I believe that maybe one the
addins I have is the cause of my problems



Nik a écrit :

elcroco wrote:
I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Areyou sure that the user won't have another file open and lose work in
that?

You could set thisworkbook.saved = true, which will tell Excel that
there are no chanegs to save. If there is only one workbook open, Excel
will quit; if there is another workbook the user will be prompted to
save changes if there are any.

Nik


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

I would like to bring a new information:

I did some changes into my code. Now, I call in sTestAppQuite,
ActiveWorkbook.Close (False) and in ThisWorkbook I put Application.Quit
into Workbook_BeforeClose(cancel as boolean).
So, now, if I have only one workbook opened, then it works properly,
but if I have several, I did some little changes in sTestAppQuite as
follow:

Sub sTestAppQuite()

dim wbk as Workbook

for each wbk in Application.Workbooks

if wbk.name < "WorkBook_SpecificName" then
wbk.close(false)
end if
' I close workbooks different from the one in which I call
Application.Quit in Wotrkbook_BeforeClose

next wbk

set wbk = ActiveWorkBook
wbk.close(false) <----- Now we go into Workbook_BeforeClose and
call Application.Quit

end sub

When I m testing this new version, all the workbooks are closed, but
not excel !!!!

Any ideas ?

Thks

G

elcroco a écrit :

I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Thanks

G


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Application.Quit

I meant add it before the code that you have, not just on its own.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"elcroco" wrote in message
ups.com...
Bob, I m not sure that your proposal answers properly to my question,
because this line of code close the workbook but not excel


Bob Phillips a écrit :

Maybe try

Activeworkbook.Close Savechanges:=False

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"elcroco" wrote in message
ups.com...
Hi,

I forgot in my first message the Application.DisplayAlerts = False I
have set in my procedure
It doesn't work because the "Save" dialog box is not an alert

G


Roger Govier a écrit :

Hi

Application.DisplayAlerts = False

--
Regards

Roger Govier


"elcroco" wrote in message
ups.com...
I would like to use this function in one of my application.So I wrote
the following code:

Sub sTestAppQuite()

Application.Display
Application.Quit

End Sub

When I m testing it, the "Save" dialog box opens, asking me whether or
not I want to save the workbook. As I would like to avoid this
behaviour, what I hhave to do ???

Thanks

G



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
difference application.quit & application.close Pierre via OfficeKB.com[_2_] Excel Programming 4 November 8th 05 07:55 PM
Application.Quit bawahoo[_2_] Excel Programming 2 October 14th 04 08:33 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
Quit Application Robert Black Excel Programming 1 July 31st 03 04:15 PM


All times are GMT +1. The time now is 09:35 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"