J
Jeff Armstrong
I am trying to store the file name of a text file that I
open. The following code is what I am trying to use but
when I watch the variable for TrunkName it always ends up
being "". Can someone tell me what I am doing wrong?
**********************************************************
Public Sub DoTheImport()
Dim FName As Variant
Dim Sep As String
Dim TrunkName as String
ImportFileNames
daRows = Application.CountA(ActiveSheet.Range"A:A"))
For zZ = 1 To daRows 'Set up loop
Open Cells(zZ, 1) For Input Access Read As #1
TrunkName = Application.FileSearch.Filename
Sep = " "
ImportTextFile CStr(FName), Sep
Close #1
Next 'Close the file
End Sub
**********************************************************
Thanks,
Jeff
open. The following code is what I am trying to use but
when I watch the variable for TrunkName it always ends up
being "". Can someone tell me what I am doing wrong?
**********************************************************
Public Sub DoTheImport()
Dim FName As Variant
Dim Sep As String
Dim TrunkName as String
ImportFileNames
daRows = Application.CountA(ActiveSheet.Range"A:A"))
For zZ = 1 To daRows 'Set up loop
Open Cells(zZ, 1) For Input Access Read As #1
TrunkName = Application.FileSearch.Filename
Sep = " "
ImportTextFile CStr(FName), Sep
Close #1
Next 'Close the file
End Sub
**********************************************************
Thanks,
Jeff