2
VBAを使用しているフォルダからすべてのファイルをdosにunix形式に変換したい。VBAでDosからUnixにファイルを変換する方法
ドライブからすべてのファイルを見つけるには、次のコードを使用します。
Sub list_all_files(myFilepath As String, filecounter() As Variant, counter1 As Integer)
With Application.FileSearch
.NewSearch
.LookIn = myFilepath
.filename = "*.*"
counter = 0
If .Execute(SortBy:=msoSortByLastModified, SortOrder:=msoSortOrderDescending) > 0 Then
counter1 = .FoundFiles.Count
For i1 = 1 To .FoundFiles.Count
counter = counter + 1
filecounter(counter) = .FoundFiles(i1)
Next i1
End If
End With
End Sub
しかし、arrayof(ファイル)を変換する方法。同じパスにファイルを保存したい。
ありがとうございます。
(1) 'Application.FileSearch'はxl07以降では推奨されていません。再帰的 'Dir'または' FileStystemObject'ルーチンを実行してファイルを取得します(2)これらはすべて 'txt'ファイルであると推測しますが、どうして' *。* 'を探していますか? – brettdj