Dir or Dir$ Function can be used in Microsoft Visual Basic (Applications) to get the list of directories or files
sDir = Dir$(sPath & "*.xls", vbNormal)
Do Until LenB(sDir) = 0
Set oWB = Workbooks.Open(sPath & sDir)
‘ Do some stuff
oWB.close
sDir = Dir$
Loop
The above will open all Excel Workbooks under a particular directory.
Showing posts with label get the list of directories or files using VBA Dir Function. Show all posts
Showing posts with label get the list of directories or files using VBA Dir Function. Show all posts
Thursday, December 14, 2006
Subscribe to:
Posts (Atom)
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.