Hoi HVS en edoor,
Misschien heeft het wel hier mee te maken, zie hieronder komende code uit formulier (VBA):
Private Sub Workbook_Open()
Sheets("6S Scherm").Select
ActiveWindow.DisplayWorkbookTabs = False
Application.DisplayFullScreen = True
Application.Caption = "Application 2013 Created by Kees Antens"
Application.DisplayAlerts = False
iTijd = Hour(Time)
If iTijd >= 0 And iTijd < 6 Then sGroet = "Goedenacht"
If iTijd >= 6 And iTijd < 12 Then sGroet = "Goedemorgen"
If iTijd >= 12 And iTijd < 18 Then sGroet = "Goedemiddag"
If iTijd >= 18 And iTijd <= 23 Then sGroet = "Goedenavond"
MsgBox sGroet & " Auditeur & Operator veel succes!", vbInformation, "Hallo gebruiker! " & Format(Date, "dddd d mmmm yyyy") & " " & Format(Time, "hh:mm:ss")
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
MsgBox sGroet & "Houdoe & bedankt Auditeur & Operator!", vbInformation, "Houdoe & bedankt! " & Format(Date, "dddd d mmmm yyyy") & " " & Format(Time, "hh:mm:ss")
Application.DisplayAlerts = True
Application.Quit
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
ActiveWindow.DisplayWorkbookTabs = True
End Sub
Als ik alle codes uit het formulier haal werkt het wel, jouw code:
Sub Diagram29_Klikken()
Dim w As Workbook, y As Long
For Each w In Workbooks
y = y + 1
Next
If y = 1 Then
ThisWorkbook.Save
Application.Quit
Else
ThisWorkbook.Close True
End If
End Sub
Zit er een fout in de code van het formulier????
Groetjes,
Kees