This loop returns "method open of object workbooks failed" when it should end:
Any suggestions?
Thanks,
willardio
Code:
StrPath = "C:\Documents and Settings\" & Environ("username") & "\Desktop\field reports\"
StrFile = Dir(StrPath & SubgCode & "*" & ".xlsm")
Do While Len(StrFile) > 0
'here's where it gets stuck after the directory runs out of files beginning with the specified string (as defined by "Subgcode"):
Workbooks.Open StrPath & StrFile
Thanks,
willardio