Hi,
I am trying to pass a ListBox to a function as an argument but when calling the function I get a mismatch on the name of the ListBox, I have put the code below.
```
Function listAvailableFiles(FolderPath As String, DropDown As ListBox) Dim File As String Dim j As Integer File = Dir(FolderPath & "\*.cdr") Do While File <> "" DropDown.AddItem File File = Dir Loop End Function Private Sub UserForm_Activate() Dim DimensionFolder As String DimensionFolder = "C:\Users\cwats\OneDrive - Watson Memorials\Watson Memorials\Designs Template and Drawings\MD UK\Memorial Shapes\Foundations" Call listAvailableFiles(DimensionFolder, ListDimensionFilesDropdown) End Sub```Any help on this will be greatly appreciated, I've been googling it for 2 hours TIA
Function listAvailableFiles(FolderPath As String, DropDown As ListBox) Dim File As String Dim j As Integer File = Dir(FolderPath & "\*.cdr") Do While File <> "" DropDown.AddItem File File = Dir Loop End Function Private Sub UserForm_Activate() Dim DimensionFolder As String DimensionFolder = "C:\Users\cwats\OneDrive - Watson Memorials\Watson Memorials\Designs Template and Drawings\MD UK\Memorial Shapes\Foundations" Call listAvailableFiles(DimensionFolder, ListDimensionFilesDropdown) End Sub