AW: AutoShape finden
29.01.2004 15:40:55
Timo
Hallo,
danke für die Antworten aber ich komme damit nicht klar. Ich wäre dir sehr dankbar wenn du dir mein Code anschauen würdest. Es funktioniert in Prinzip aber ich kann es nicht variabel gestalten d.H. es werden sowohl keine Shapes als auch keine Mappen durchsucht, nur das eine Shape und die aktuelle Arbeitsmappe. Ich danke schon im Voraus für Antwort, Viele Grüße
Timo
Sub Sichern()
Dim AlterName, Neuername
Dim Datei As String
Dim Active As Workbook
On Error GoTo Meldung
Monat = Month(Now)
If Day(Now) - 15 <= 10 Then
Monat = Monat - 1
End If
If Monat - 2 < 1 Then
Archivmonat = Monat - 2 + 12
Archivjahr = Year(Now) - 1
Else
Archivmonat = Monat - 2
Archivjahr = Year(Now)
End If
Archivname = "Stand_" & Archivmonat & "_" & Archivjahr & ".xls"
FileCopy "c:\aktuell.xls", "c:\Aktuell_alt.xls"
AlterName = "c:\Vormonat.xls": Neuername = "c:\" & Archivname
Name AlterName As Neuername
AlterName = "c:\Aktuell_alt.xls": Neuername = "c:\Vormonat.xls"
Name AlterName As Neuername
Datei = "c:\vormonat.xls"
Workbooks.Open Datei
Set Active = Application.ActiveWorkbook
ActiveSheet.Shapes("AutoShape 3").Select
Selection.Characters.Text = "Neu"
Selection.ShapeRange.Item(3).Hyperlink.Address = "Aktuell.xls"
Workbooks("c:\vormonat.xls").Close SaveChanges:=True
Exit Sub
Meldung:
titel1 = "Fehler"
Mel0 = "Sie haben die Datei bereits einmal gesichert."
antwort = MsgBox(Mel0 + Chr(13), vbOKOnly, titel1)
End Sub