#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Find File

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.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200712/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Find File

I removed som space around the *

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

filename = dir(MyPath)


"jln via OfficeKB.com" wrote:

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.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200712/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Find File

Sorry Joel That doesnt seem to find the file.

Joel wrote:
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.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200712/1

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Find File

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.




"jln via OfficeKB.com" wrote:

Sorry Joel That doesnt seem to find the file.

Joel wrote:
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.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200712/1


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Find File

Joel

I see what your saying now when I add \ctj*.csv it stops working

Joel wrote:
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]
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.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200712/1

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find a deleted excel file? Or an autosave file? Aladriel Excel Discussion (Misc queries) 10 January 3rd 08 07:46 PM
how to find find last file name and increment - XL2000 dunescratcher[_2_] Excel Programming 0 April 6th 06 07:35 PM
clicking .XLS file opens Excel 2003 but doesn't find the file Arrow Computer Excel Discussion (Misc queries) 2 August 10th 05 03:51 AM
How do I find a file/spreadsheet that Excel says is Already open but I can't find it? nwtrader8 Excel Discussion (Misc queries) 5 June 21st 05 02:16 PM
Want file title listing as in Excel 5.0 File>Find jeffbro27707 Excel Discussion (Misc queries) 0 April 30th 05 07:31 PM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"