I have the following code
Dim fileSystemObject As New fileSystemObject
Dim sourceFolder As folder
Set sourceFolder = fileSystemObject.GetFolder(sourceFolderPath)
processFolder (sourceFolder)
And the processFolder procedure is declared as
Sub processFolder(folderToProcess As folder)
'Code here
End Sub
What I find strange is that whenever I type Folder with a capital ‘F’, VBA editor converts it to folder with a small ‘f’. And I get a compile error message that there is type mismatch when I call the procedure. Can someone tell me what I am doing wrong here?
The parentheses here;
convert
sourceFolderto a string which cannot be passed to something expecting aFolderso instead;