+ Reply to Thread
Results 1 to 3 of 3

how to call a file same extension but different name.

  1. #1
    Registered User
    Join Date
    08-18-2010
    Location
    MALTA
    MS-Off Ver
    Excel 2007
    Posts
    2

    how to call a file same extension but different name.

    i have a system which every week it generates afile Data_08-18-10_11-02-58.csv however the data will change according the day of compilation.

    now i am writing a script to tailor this data inside .. however i am finding a problem to extrect the data from .csv to excel because of the specific name!

    Sheets("Data").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
    "TEXT;C:\Documents and Settings\ryan schembri\Desktop\ARsystem\Data_08-18-10_11-02-58.csv ", Destination:=Range("$A$1"))
    etc.....................

    (like this it will opens no problem but only for this day)

    how can i write something generic such as *.csv (any name but ends with the extention .csv)

    because when the file is updated and writes the new Date i cant open it as the code i wrote...

    any help pls?

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: how to call a file same extension but different name.

    The following code will loop through all of the CSV files in a specified directory - I don't know if that helps you:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-18-2010
    Location
    MALTA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: how to call a file same extension but different name.

    thanks for your reply ... but i couldn`t make it work

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1