Kompatibilitätsproblem mit Excel 97
07.07.2003 06:52:19
chris b
wollte es gerade auf der Arbeit testen und da geht es nicht weil wir hier Excel 97haben und ich das Makro daheim mit Excel 2000 gemacht habe.
Ich hoffe es gibt eine möglichkein dieses Problem zu lösen.UNd ihr helft mir dabei vielen Dank Christian
Sub beginn()
Cells.ClearContents
Dim Directory$, stFile$, Msg$, dName$
Dim R%, C%
Msg = "Bitte Verzeichnis angeben:" & Chr(13) & _
"(ohne abschließenden Backslash)"
Directory = InputBox(Msg, Application.UserName)
If Directory = "" Then Exit Sub
Directory = Directory & "\"
stFile = Dir(Directory & "*.*", vbDirectory)
Do While stFile <> ""
If stFile = "." Or stFile = ".." Then
ElseIf (GetAttr(Directory & stFile) And _
vbDirectory) = vbDirectory Then
R = R + 1
Cells(R, 1) = Directory & stFile
End If
stFile = Dir()
Loop
Call kopieren
End Sub
Sub kopieren()
Dim sQuelle$, sZiel$, sDatei$, cb$
Dim I As Integer
lrow = Cells(Rows.Count, 1).End(xlUp).Row
qDatei = InputBox("Bitte neue Zieldatei angeben mit Endung ", "Name")
For x = 1 To lrow
cb = Cells(x, 1)
Quelle = cb & "\"
ziel = cb & "\"
With Application.FileSearch
.LookIn = cb
.FileType = msoFileTypeAllFiles
.Filename = "o*.*"
cb = .FoundFiles(1)
End With
FileCopy cb, ziel & qDatei
Next
MsgBox "Dateien wurde kopiert!"
End Sub