• Privacywetgeving
    Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.

excel afsluiten zonder op te slaan

Status
Niet open voor verdere reacties.

ahkleine

Gebruiker
Lid geworden
1 mei 2014
Berichten
163
Halo allemaal,
Ik wil m.b.v. het kruisje rechts boven excel afsluiten zonder de vraag om geopende document op te slaan. Ik heb hierbij de volgende code staan in This Workbook. Maar het werkt niet, ik krijg de vraag niet

Code:
Private Sub Workbook_Open()


Application.ScreenUpdating = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.DisplayFormulaBar = False
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayWorkbookTabs = False
Application.ScreenUpdating = True


End Sub



Private Sub Workbook_BeforeClose()
Application.ScreenUpdating = True
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",true)"
Application.DisplayFormulaBar = True
ActiveWindow.DisplayGridlines = True
ActiveWindow.DisplayHeadings = True
ActiveWindow.DisplayWorkbookTabs = True
Application.ScreenUpdating = False
Application.Quit

End Sub
 
Niet echt duidelijk.
Je zegt dat je de vraag niet wilt en even later dat je die ook niet krijgt.

Maar kijk ook eens naar Application.DisplayAlerts
 
Dit doet het :

Code:
[COLOR=#000000][FONT=&quot][SIZE=3][FONT=inherit][B]Sub[/B][/FONT][FONT=inherit] [/FONT][FONT=inherit]ExitWithoutPrompt[/FONT][FONT=inherit]([/FONT][FONT=inherit])[/FONT][/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=&quot][SIZE=3] [/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=&quot][SIZE=3][FONT=inherit]     [/FONT][FONT=inherit]Application[/FONT][FONT=inherit].[/FONT][FONT=inherit]DisplayAlerts[/FONT][FONT=inherit] [/FONT][FONT=inherit]=[/FONT][FONT=inherit] [/FONT][FONT=inherit][B]False[/B][/FONT][/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=&quot][SIZE=3] [/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=&quot][SIZE=3][FONT=inherit]     [/FONT][FONT=inherit]Application[/FONT][FONT=inherit].[/FONT][FONT=inherit]Quit[/FONT][/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=&quot][SIZE=3] [/SIZE][/FONT][/COLOR]
[COLOR=#000000][FONT=&quot][SIZE=3][FONT=inherit][B]End[/B][/FONT][FONT=inherit] [/FONT][FONT=inherit][B]Sub[/B][/FONT][/SIZE][/FONT][/COLOR]
 
Tweede mogelijkheid :

Code:
[COLOR=#141414][FONT=&quot]ActiveWorkbook.Saved = True[/FONT][/COLOR]
[COLOR=#141414][FONT=&quot]Application.Quit[/FONT][/COLOR]
 
Die in #4 moet dan wel per open werkboek worden gedaan.
 
Het werkt

Hallo,
Ik heb het werkend met jullie adviezen. Hiervoor mijn dank
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan