Find File

  • Thread starter jln via OfficeKB.com
  • Start date
J

jln via OfficeKB.com

OK what im trying to do is this

MyPath = "Q:\FTP\as400\WinRAR\Production\Inv" & inv & "\CTJ" & CurrentMonth
& inv & "_ * .csv"

Where the * is I need to find the file in this folder name is CTJ current
month INV number then _ and after the under score it could be any combo of
numbers. The file will always have CTJ at the start.
 
J

Joel

I removed som space around the *

MyPath = "Q:\FTP\as400\WinRAR\Production\Inv" & inv & "\CTJ" & CurrentMonth
& inv & "_*.csv"

filename = dir(MyPath)
 
J

jln via OfficeKB.com

Sorry Joel That doesnt seem to find the file.
I removed som space around the *

MyPath = "Q:\FTP\as400\WinRAR\Production\Inv" & inv & "\CTJ" & CurrentMonth
& inv & "_*.csv"

filename = dir(MyPath)
OK what im trying to do is this
[quoted text clipped - 4 lines]
month INV number then _ and after the under score it could be any combo of
numbers. The file will always have CTJ at the start.
 
J

Joel

I it finding any files or is it just returning an empty string? There may be
multiple files meeting the same criteria.

If it returning nothing then you need to debug the code yourself.
try this
MyPath = "Q:\FTP\as400\WinRAR\Production\Inv" & inv & "\*.csv"
filename = dir(MyPath)

See if this returns a file. if it does, then keep on adding your parameters
Sorry Joel That doesnt seem to find the file.
I removed som space around the *

MyPath = "Q:\FTP\as400\WinRAR\Production\Inv" & inv & "\CTJ" & CurrentMonth
& inv & "_*.csv"

filename = dir(MyPath)
OK what im trying to do is this
[quoted text clipped - 4 lines]
month INV number then _ and after the under score it could be any combo of
numbers. The file will always have CTJ at the start.
 
J

jln via OfficeKB.com

Joel

I see what your saying now when I add \ctj*.csv it stops working
I it finding any files or is it just returning an empty string? There may be
multiple files meeting the same criteria.

If it returning nothing then you need to debug the code yourself.
try this
MyPath = "Q:\FTP\as400\WinRAR\Production\Inv" & inv & "\*.csv"
filename = dir(MyPath)

See if this returns a file. if it does, then keep on adding your parameters
on the end of Mypath until it stops returning data. This should help you
isolate where the problem is located.
Sorry Joel That doesnt seem to find the file.
[quoted text clipped - 10 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top