i can't get the progress windows with copyFile
Working example:
Sub File()
Dim FSO As Object
Dim foi As Object
Dim fo As Object
Dim fi As Object
Dim testfs As String
Dim FileIO
Set FSO = CreateObject("Scripting.FileSystemObject")
'Set FSO = CreateObject("Scripting.FileSystemObject")
'Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set fo = FSO.GetFolder("C:\Users\Peer\Desktop\Cache\vba\NeuerOrdner\")
For Each foi In fo.Files
Debug.Print foi.Name
testfs = foi.Name
Next foi
Set fi = FSO.GetFile(fo.Path & "\" & testfs)
'working copy
FSO.CopyFile fi.Path, fi.ParentFolder.Path & "\NeuerOrdner\", True
End Sub
This results in an error
'Error: Object required (Error 424)
FSO.CopyFile fi.Path, fi.ParentFolder.Path & "\NeuerOrdner\", FileIO.UIOption.AllDialogs
Additionally i cant use brackets like in the example, and i'm not sure why
'Compile Error: Expected: =
FSO.CopyFile(fi.Path, fi.ParentFolder.Path & "\NeuerOrdner\", True)
i have the Solution from here: How to bring up the built-in File Copy dialog?