Hi,
I'm having a bit of trouble with this and I'm hoping that somebody can help me!? I'm wanting to show the names of avaliable files in a combo or list box. At the moment I have the following coding
Private Sub UploadButton_Click()
With Application.FileSearch
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents\ScoreCards\Trial"
.SearchSubFolders = True
.FileType = msoFileTypeExcelWorkbooks
End With
End Sub
This shows me the number of files in a message box, and then proceds to show me the path to those files. What I would like to happen is for those files to be shown in a combo or list box instead. Is this possible? And if so, how can I manipulate the coding I have at the moment, to do this?
Thanks
Jane
[PC2]
I'm having a bit of trouble with this and I'm hoping that somebody can help me!? I'm wanting to show the names of avaliable files in a combo or list box. At the moment I have the following coding
Private Sub UploadButton_Click()
With Application.FileSearch
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents\ScoreCards\Trial"
.SearchSubFolders = True
.FileType = msoFileTypeExcelWorkbooks
End With
End Sub
This shows me the number of files in a message box, and then proceds to show me the path to those files. What I would like to happen is for those files to be shown in a combo or list box instead. Is this possible? And if so, how can I manipulate the coding I have at the moment, to do this?
Thanks
Jane
[PC2]