Results 1 to 20 of 22

Thread: Browse a Folder and Populate Listbox with Folder Items

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #19
    snb
    Guest
    To populate the listbox:

    Sub snb()
    With Application.FileDialog(msoFileDialogFolderPicker)
        If .Show = -1 Then ListBox1.List = Split(CreateObject("wscript.shell").exec("cmd /c dir " & .SelectedItems(1) & "\*.txt /b").StdOut.readall, vbCrLf)
    End With
    End Sub
    Last edited by Aussiebear; 03-14-2025 at 11:23 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •