Hello all,
I have some code that uses the DIR function to loop through excel workbooks in a directory. This code works in VBA 2007, but in VBA 2003 it is not picking up the excel filenames in the directory. Here is a sample of the code:
Any help in determining the problem would be appreciated!!
Thanks!
I have some code that uses the DIR function to loop through excel workbooks in a directory. This code works in VBA 2007, but in VBA 2003 it is not picking up the excel filenames in the directory. Here is a sample of the code:
Code:
lCount = 0
sFil = Dir("*.xls")
Do While sFil <> ""
lCount = lCount + 1
Set inputWB = Workbooks.Open(InputDIR _
& "\" _
& sFil)
inputWB = ActiveWorkbook
' *----------------------------------*
' * Retrieve Data *
' *----------------------------------*
' *
Range("E8").Select
COUNTY_ID = ActiveCell.Value
.
.
.
.
Any help in determining the problem would be appreciated!!
Thanks!