ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Subject: Excel VBA .Lookin Error 9/9/2005 7:14 AM PST (https://www.excelbanter.com/excel-programming/339612-subject-excel-vba-lookin-error-9-9-2005-7-14-am-pst.html)

Bryan Toma[_2_]

Subject: Excel VBA .Lookin Error 9/9/2005 7:14 AM PST
 

Am using good code to search directory/folders for various filenames, size,
last date modified...
See code
Directory = MyPath 'custom path (MyPath = reference to specific cell's
text value)
With Application.FileSearch 'look for Excel Files
.NewSearch
.LookIn = Directory
.FileName = ".xls"
.SearchSubFolders = False
.Execute
.Count
For I = 1 To .FoundFiles.Count
Cells(r, 1) = .FoundFiles(I)
Cells(r, 2) = FileLen(.FoundFiles(I))
Cells(r, 3) = FileDateTime(.FoundFiles(I))
r = r + 1
--
My problem is that .Lookin references a folder on my harddrive instead of a
server location specified by varialble named "MyPath". Can't seem to
redirect Lookin to MyPath. Using MyPath instead of, for example:
"P:\Finance\Data\..."

Any suggestions?
Thanks,
Bryan Toma



All times are GMT +1. The time now is 06:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com