Hello,
I am trying to loop through a directory of files. In the test environmnet, I have 3 files; the source file which contains the macro which is skipped over and two other files, which need evaluation. The first iteration finds a file, however on the strFile=Dir() line it throws an error-"Invalid procedure call or argument." This is very puzzling. Thank you for your help.
While strFile <> ""
If strFile <> strName Then
Set wb = Workbooks.Open(strPath & strFile)
wb.Activate
wb.Sheets("Sheet1").Delete
FinalOutputPath = Left(strPath, 55)
Call Transpose(FinalOutputPath)
strFile = Dir()
Else: strFile = Dir()
End If
Wend
I am trying to loop through a directory of files. In the test environmnet, I have 3 files; the source file which contains the macro which is skipped over and two other files, which need evaluation. The first iteration finds a file, however on the strFile=Dir() line it throws an error-"Invalid procedure call or argument." This is very puzzling. Thank you for your help.
While strFile <> ""
If strFile <> strName Then
Set wb = Workbooks.Open(strPath & strFile)
wb.Activate
wb.Sheets("Sheet1").Delete
FinalOutputPath = Left(strPath, 55)
Call Transpose(FinalOutputPath)
strFile = Dir()
Else: strFile = Dir()
End If
Wend