I'm using the following code to find files in a folder and add them to a list box.
This code does not find files on the server when the files clearly exists there. I've tried to find this error for a VERY long time now. I put it on a different computer that only had a G drive, and changed the code to use "g:\archiveap" and copied the files from the other computer to that folder, and it found them just fine. I don't understand.
Thanks for any help you can provide.
-Pete
Code:
Private Sub UpdateFileName()
Set fs = Application.FileSearch
fs.NewSearch
fs.LookIn = "h:\archiveap"
fs.Filename = "APACP" & ComboReportname.Value & "_" & ListYear.Value & ListMonth.Value & "*"
fs.Execute
For i = 1 To fs.FoundFiles.Count
lstFiles.AddItem Dir(fs.FoundFiles(i))
Next i
End Sub
This code does not find files on the server when the files clearly exists there. I've tried to find this error for a VERY long time now. I put it on a different computer that only had a G drive, and changed the code to use "g:\archiveap" and copied the files from the other computer to that folder, and it found them just fine. I don't understand.
Thanks for any help you can provide.
-Pete