0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ああ

Posted at

Sub ListFilesInFolder(folderPath As String)
Dim fso As Variant
Dim folder As Variant
Dim file As Variant

' FileSystemObject を作成
Set fso = CreateObject("Scripting.FileSystemObject")

' 指定フォルダを取得
If fso.FolderExists(folderPath) Then
    Set folder = fso.GetFolder(folderPath)
    
    ' フォルダ内のすべてのファイルを列挙
    For Each file In folder.Files
        Print file.Path  ' ファイルのフルパスを表示
    Next
Else
    Print "フォルダが存在しません: " & folderPath
End If

' 解放
Set file = Nothing
Set folder = Nothing
Set fso = Nothing

End Sub

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?