Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have been using this code to open all XL files in a certain directory. Works well sometimes but if I am in Excel and go to File - Open and change the directory to a completly different drive the Dir function remembers this drive rather than the one I am telling it. What can I do to force the Dir to always look at my specific directory? Thanks Sub aaa() Dim sPath As String Dim sfil As String Dim strName As String sPath = "C:\Users\Test\Excel\" sfil = Dir("*.xls") ChDir sPath Do While sfil < "" strName = sPath & sfil Workbooks.Open (strName) sfil = Dir Loop End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User selection of folder and open all .xls files within folder | Excel Programming | |||
Open files in folder - skip if already open | Excel Programming | |||
Open all files in a folder | Excel Programming | |||
Open Excel files in a folder | Excel Programming | |||
open all files in a folder and ... | Excel Programming |