Dear All,
I cannot understand why the following code does not work, when a previous programme using the same code works perfectly.
I am trying to obtain the complete name of a file, when I know part of that name, the part that I know being 521026. The “*.*”, should provide the remainder of the file name, but all I get is “521026*.*”. Why?
This is the code:
"C:\X\Finance\" is the folder, and CellStatus is read by another part of the programme. I am expecting the file name to be "521026 WT0841.pdf".
Regards,
john
I cannot understand why the following code does not work, when a previous programme using the same code works perfectly.
I am trying to obtain the complete name of a file, when I know part of that name, the part that I know being 521026. The “*.*”, should provide the remainder of the file name, but all I get is “521026*.*”. Why?
This is the code:
Code:
With Application.FileSearch
.LookIn = "C:\X\Finance\"
.FileName = CellStatus & "*.*"
If .Execute > 0 Then
Call SetHyperlink
Else
GoTo LookAgain
End If
End With
"C:\X\Finance\" is the folder, and CellStatus is read by another part of the programme. I am expecting the file name to be "521026 WT0841.pdf".
Regards,
john