View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Zimski Bob Zimski is offline
external usenet poster
 
Posts: 30
Default Type Mismatch Error 13

Why do I get the error? Oddly enough, I can use the commented line for the
debug.print, but when I try to assign to an array it gives the error.

I'm totally confused.

Bob

Dim FName as Variant
Set fs = Workbooks.Application.FileSearch
With fs
.LookIn = "E:\Stott\Inventory"
'.FileType = msoFileTypeExcelWorkbooks
.FileName = "Input??.xls"
.Execute
End With

For i = 1 To fs.FoundFiles.Count
FName(i) = fs.FoundFiles(i)
'Debug.Print fs.FoundFiles(i)
Next i