I found the following code in an earlier thread and modified it but I did something wrong. I define strFolderName in a startup routine. When I stop the code and check values strFile is set to a file in the appropriate directory but when it gets to the Open for Input statement the Error File not found appears. What did I miss?
Dim strFile As String
strFile = Dir(strFolderName & "", vbNormal)
Do While (Len(strFile) > 0)
Open strFile For Input As #1
' various operations
strFile = Dir
Loop
Dim strFile As String
strFile = Dir(strFolderName & "", vbNormal)
Do While (Len(strFile) > 0)
Open strFile For Input As #1
' various operations
strFile = Dir
Loop