Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This code put all "excel" files in ListBox1 from folder who start with name
in TextBox1. Can I change cod that he put all files from any folder(folder and files < excel file). Private Sub CommandButton1_Click() Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Set objFSO = CreateObject("Scripting.FileSystemObject") On Error Resume Next Set objFolder = objFSO.GetFolder(Me.TextBox1.Text) On Error GoTo 0 If Not objFolder Is Nothing Then For Each objFile In objFolder.Files If objFile.Type = "Microsoft Excel Worksheet" Then Me.ListBox1.AddItem objFile.Name End If Next End If End Sub Regards Lopar |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete/Copy Path Too Long Files | Excel Discussion (Misc queries) | |||
opening files simultaneously with same name but different path | Excel Discussion (Misc queries) | |||
Show full path of files being saved | Excel Discussion (Misc queries) | |||
I need to change the path of the linked files - thousands of them. | Excel Discussion (Misc queries) | |||
Macros i xla-files get incorrect path | Excel Programming |