0
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFolder = fso.GetFolder("C:\New folder _1")

I am using this code to read the folderpath. objFolder will store the path of the folder. In the same way, when i run the total code, i need to get a dialogue box where i should be able to enter the folderpath.

1 Answers1

0

This script to Browse4File : browse files in folder

and this code for Browse4Folder :

Option Explicit
Dim RootFolder
RootFolder = Browse4Folder
MsgBox RootFolder,VbInformation,RootFolder
'**********************************************************************************************
Function Browse4Folder()
    Dim objShell,objFolder,Message
    Message = "Please select a folder in order to scan into it and its subfolders"
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.BrowseForFolder(0,Message,1,"c:\Programs")
    If objFolder Is Nothing Then
        Wscript.Quit
    End If
    Browse4Folder = objFolder.self.path
end Function
'**********************************************************************************************
Community
  • 1
  • 1
Hackoo
  • 18,337
  • 3
  • 40
  • 70