1.4k Aufrufe
Gefragt in Skripte(PHP,ASP,Perl...) von fvdepo Einsteiger_in (3 Punkte)
Hier das Makro welches in OF2003 auch prima funktioniert hat. Leider hat Microsoft die Funktion Application.FileSerach sang und klanglos in Office 2007 verschwinden lassen. Wie kann ich das Makro wieder zum laufen bringen. Am besten ohne große Veränderungen.

Sub copy_ex()

Dim Such
Dim Ziel
Dim Extern
Dim Intern
Dim Frei

Dim i As Long, TotFiles As Long
Dim gefFile As String, dname As String
Dim Suchpfad As String, suchbegriff As String, Zielpfad As String
Dim oldStatus As Variant, dateiform As String

Such = Range("G1").Value
Ziel = Range("C7").Value

Extern = "extern"

Suchpfad = ("d:\Data\" & Such & "\" & Extern)
If Suchpfad = "" Then Exit Sub
Zielpfad = ("d:\Data\Deutsch\" & "Projekt" & "-" & Ziel & "\Extern")
If Zielpfad = "" Then Exit Sub
dateiform = ("*.*")
If dateiform = "" Then Exit Sub
Application.ScreenUpdating = True
oldStatus = Application.StatusBar
With Application.FileSearch
.LookIn = Suchpfad

.SearchSubFolders = True
.Filename = dateiform
If .Execute() > 0 Then
TotFiles = .FoundFiles.Count
Application.StatusBar = "Total " & TotFiles & " gefunden"
For i = 1 To .FoundFiles.Count
gefFile = Right(.FoundFiles(i), Len(.FoundFiles(i)) - InStrRev(.FoundFiles(i), "\", -1))
FileCopy Suchpfad & "\" & gefFile, Zielpfad & "\" & gefFile
Next i
End If
End With
Application.StatusBar = oldStatus
Application.ScreenUpdating = True
End Sub

Deine Antwort

Dein angezeigter Name (optional):
Datenschutz: Deine Email-Adresse benutzen wir ausschließlich, um dir Benachrichtigungen zu schicken. Es gilt unsere Datenschutzerklärung.
Anti-Spam-Captcha:
Bitte logge dich ein oder melde dich neu an, um das Anti-Spam-Captcha zu vermeiden.
...