I have written a code which will extract all the sub folders which is present inside a particular folder/Directory. Here is the code.
ComboBox10.List = Split(CreateObject("wscript.shell").exec("cmd /c Dir ""C:\Users\inkapb\AppData\Local\Temp\EPC AutoTool\Projects\*."" /b /s").stdout.readall, vbCrLf)
Here in the above code all the sub folder path is getting populated instead of the subfolder name. Can any one help me to achieve my requirement
In your command button code you could use something like this.
When I use this, just the folder names show up, not the path.
I used C:\ as the main folder in this example.
Once clicked this will be the result
When you do select a sub-folder, then second combobox will show the files.
Those results will look like this
I have a different piece of suggestion to serve your requirement.
You could try a Replace() function with the full path name. Hence: