How to capture subfolder names with VB6
Posted on 2007-10-14
I'm trying to create a program that will capture subfolder names in a given folder. I have the following code:
Private mfso As Scripting.FileSystemObject
Dim objFolder As Scripting.Folder
For Each objFolder In mfso.GetFolder("C:\test").SubFolders
MsgBox "folder found"
Now I know this won't capture the name, but I'm trying to figure out how I want to proceed. I thought this code could help me find each subfolder that exists in C:\test. When I run this code, I get the following error:
Run-time error '91':
Object variable or With block variable not set
Does anyone know what I'm doing wrong?