Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Lagerbestand aktuell").Select
On Error Resume Next
Application.OnTime EarliestTime:=VaEt, Procedure:="Zeitmakro", Schedule:=False
ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=1
ActiveWorkbook.Save
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"V:\Backup\Kopie BL " & Format(Now, "YYYY-MM-DD"), FileFormat:=xlNormal _
, Password:="", WriteResPassword:="sicher", ReadOnlyRecommended:=False, _
CreateBackup:=False
If Application.Workbooks.Count <= 2 Then
Application.Quit
Else
ActiveWorkbook.Close
End If
End Sub
Option Explicit
Public VaEt As Variant
Public DaZeit As Date
Sub Zeitmakro()
'**************************************************
'* H. Ziplies *
'* 18.02.04 *
'* erstellt von Hajo.Ziplies@web.de *
'* http://home.media-n.de/ziplies/ *
'* *
'**************************************************
ThisWorkbook.Worksheets("Lagerbestand aktuell").Range("a1") = ThisWorkbook.Worksheets("Lagerbestand aktuell").Range("a1") - CDate("00:00:01")
If ThisWorkbook.Worksheets("Lagerbestand aktuell").Range("a1") <> 0 Then
VaEt = Now + TimeValue("00:00:01")
Application.OnTime VaEt, "Zeitmakro"
Else
ThisWorkbook.Close True 'speichern
' Meldung bei Excel immer in Vordergrund
' Dim mldg
' mldg = MsgBox("Endzeit erreicht", 1048576, "Endzeit")
' 1048576 entspricht vbMsgBoxRtlReading
End If
Application.WindowState = xlMaximized
ActiveWindow.WindowState = xlMaximized
End SubOption Explicit
Private Sub Workbook_Open()
DaZeit = "0:10:00"
ThisWorkbook.Worksheets("Lagerbestand aktuell").Range("a1") = CDate(DaZeit)
Zeitmakro
End Sub
Private Sub workbook_beforeclose(cancel As Boolean)
Sheets("Lagerbestand aktuell").Select
On Error Resume Next
Application.OnTime EarliestTime:=VaEt, Procedure:="Zeitmakro", Schedule:=False
ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=1
ActiveWorkbook.Save
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"V:\Backup\Kopie BL " & Format(Now, "YYYY-MM-DD ") & Format(Now, "HH") & " Uhr", FileFormat:=xlOpenXMLWorkbookMacroEnabled _
, Password:="", WriteResPassword:="sicher", ReadOnlyRecommended:=False, _
CreateBackup:=False
If Application.Workbooks.Count <= 2 Then
Application.Quit
Else
ActiveWorkbook.Close
End If
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
ThisWorkbook.Worksheets("Lagerbestand aktuell").Range("a1") = DaZeit
End Sub
Excel 2007
kfk 29.12.2008 - 28 Hits - 1 Antwort
Passwortgeschützte Excel 2007-Datei in Excel 2003 öffnen
Kara09 05.06.2009 - 793 Hits - 2 Antworten
Office 2007 Excel 2007 kann Passwortgeschützte Datei auf anderem Rechner nicht öffnen
DerStephan 17.12.2009 - 325 Hits - 5 Antworten
Excel 2007 Änderungen in Excel-Optionen speichern
kati2 27.01.2010 - 345 Hits - 5 Antworten
Excel 2007: Excel ändert meine Eingabe auf ein anderes Zahlenformat
Trouble99 20.02.2010 - 366 Hits - 3 Antworten