Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
difference application.quit & application.close | Excel Programming | |||
Application.Quit | Excel Programming | |||
macro to close excel application other than application.quit | Excel Programming | |||
application.quit will not shut off application | Excel Programming | |||
Quit Application | Excel Programming |