geebra
12-28-2021, 11:57 AM
Hi,
I can't seem to get this converted correctly, any help is appreciated.
Dim fs
Dim i As Integer
Dim stlen As Integer
Set fs = Application.FileSearch
With fs
.LookIn = ActiveWorkbook.Path + "" + "Reports"
.filename = "*.rpt"
If .Execute(SortBy:=msoSortByFileName, SortOrder:=msoSortOrderAscending) > 0 Then
ComboBox1.Clear
stlen = Len(ActiveWorkbook.Path + "" + "Reports") + 1
For i = 1 To .FoundFiles.Count
ComboBox1.AddItem Mid(.FoundFiles(i), stlen)
Next i
ComboBox1.Value = Mid(.FoundFiles(1), stlen)
populate_archive
End If
End With
I can't seem to get this converted correctly, any help is appreciated.
Dim fs
Dim i As Integer
Dim stlen As Integer
Set fs = Application.FileSearch
With fs
.LookIn = ActiveWorkbook.Path + "" + "Reports"
.filename = "*.rpt"
If .Execute(SortBy:=msoSortByFileName, SortOrder:=msoSortOrderAscending) > 0 Then
ComboBox1.Clear
stlen = Len(ActiveWorkbook.Path + "" + "Reports") + 1
For i = 1 To .FoundFiles.Count
ComboBox1.AddItem Mid(.FoundFiles(i), stlen)
Next i
ComboBox1.Value = Mid(.FoundFiles(1), stlen)
populate_archive
End If
End With