Sunday, March 6, 2016

LoadLibrary files Folder Wise

***********************************************************
Load Library files Folder Wise
***********************************************************

Below is the function we can use to load functional lib on base on folder path

Function LoadLibraryFilesFromSubFolders(strFolderPath)
Set objFSO  = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strFolderPath)
    For Each Subfolder in objFolder.SubFolders
        Set objChildFolder = objFSO.GetFolder(Subfolder.Path)
        Set objColFiles = objChildFolder.Files
        For Each objFile In objColFiles
            If Right(objFile.Name,  3) = "vbs" Or Right(objFile.Name,  3) = "qfl"  Then             Print Subfolder.Path & "\" & objFile.Name
            LoadFunctionLibrary Subfolder.Path & "\" & objFile.Name                    
            End If
        Next
     
        Call LoadLibraryFilesFromSubFolders(Subfolder)
    Next

    Set objColFiles = Nothing
    Set objChildFolder = Nothing
    Set objFolder = Nothing
End Function

No comments:

Post a Comment