Clever-Excel-Forum

Normale Version: AutoSave Makro bei xltm Vorlage funktioniert nicht
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hallo zusammen,

ich habe eine einfache Excel-Vorlage erstellt mit einem einzigen Makro:

Option Explicit
Public nexttime As Date
Sub autosave()
ActiveWorkbook.Save
   nexttime = Now + TimeValue("00:00:30")
   Application.OnTime nexttime, "autosave"
End Sub
Sub Reset_autosave()
On Error Resume Next
Application.OnTime EarliestTime:=nexttime, _
    Procedure:="autosave", Schedule:=False
End Sub


In der xlsm-Version ist das auch kein Problem, aber sobald ich das Dateiformat in ein xltm Format speichere und die Datei wieder öffne, kommt immer die Fehlermeldung im Attachment.

Weiß jemand, was ich falsch mache?

Liebe Grüße
Paul
Hallo Paul,

vielleicht so:
Option Explicit
Public nexttime As Date
Sub autosave()
If Len(ThisWorkbook.Path) Then
ThisWorkbook.Save
Else
ThisWorkbook.SaveAs "Keine Ahnung", 52
End If
nexttime = Now + TimeValue("00:00:30")
Application.OnTime nexttime, "autosave"
End Sub
Gruß Uwe