ich habe ein Problem mit folgender Makro (liegt ganz normal in einem Modul). Wenn ich das erste Mal in das Workbook gehe, geht alles ganz normal. Schliesse ich und gehe ich nochmal in die Datei, so kann ich sie nur noch schreibgeschützt öffnen (es wird angezeigt, dass die Datei von mir benutzt wird, obwohl ich gar nicht drin bin). Wenn ich den PC neu starte geht es wieder ganz nornmal (das erste Mal). Siehgt jemand den Fehler?
Danke im Voraus!
Option Explicit
Sub F_740_Updaten()
Dim InI As Integer
Workbooks.Add
Application.DisplayAlerts = False
Application.ScreenUpdating = False ' Bildschirmaktualisierung aus
With ThisWorkbook ' Datei mit Code
ActiveWorkbook.SaveAs "PFAD\F_740.xls"
ThisWorkbook.Worksheets("Blatt1").Cells.Copy
With Workbooks("F_740").Worksheets(1).Cells
.pastespecial Paste:=xlPasteValues ' Werte
End With
Workbooks("F_740").Worksheets(1).Name = "Blatt1"
Application.CutCopyMode = False ' Zwischenspeicher löschen
Application.DisplayAlerts = False ' keine Abfrage ob Tabelle gelö _
scht werden soll
Application.DisplayAlerts = True
With Workbooks("F_740").Worksheets(1)
.Cells.HorizontalAlignment = xlCenter
.Cells.Font.Size = 9
.Columns(35).NumberFormat = "dd/mm/yy;@"
.Columns(36).NumberFormat = "dd/mm/yy;@"
.Columns(37).NumberFormat = "dd/mm/yy;@"
.Columns(1).NumberFormat = "dd/mm/yy;@"
.Columns(6).NumberFormat = "dd/mm/yy;@"
.Rows("1:25").ClearContents
.Rows("1:25").RowHeight = 1
.Rows(26).Font.Size = 6
.Columns.AutoFit
.Rows(26).AutoFilter
End With
ActiveWorkbook.Close True ' Dateikopie schließen mit _
speichern
End With
Application.ScreenUpdating = True ' Bildschirmaktualisierung ein
End Sub