+ Reply to Thread
Results 1 to 5 of 5

Unable to detect CSV file.

  1. #1
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Unable to detect CSV file.

    I have some code that prompts you to select a file to extract data from, but when I open the folder with the CSV files it is empty, but if I have a normal ".xls" file it detects it fine. The code worked on my previous PC which was Vista, butI just upgraded my PC to Windows 7 and Office 2010. Could this be the cause, or is the code not working the way it should?

    Please Login or Register  to view this content.
    Last edited by JapanDave; 09-29-2011 at 09:14 AM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Unable to detect CSV file.

    If you want the GetOpenFileName to be able to view .csv files, then you need to change the FileFilter property. To view only .csv files, you would use:
    Please Login or Register  to view this content.


    To view only .csv and .xls* files you would use:
    Please Login or Register  to view this content.


    To view all files, don't have a FileFilter property:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Unable to detect CSV file.

    Hey Tiger,
    It is actually your code.

    I tried to change the code without success obviously. Is there a reason why the CSV files don't have an asterix at the end only at the start , but the ".xls" files have the asterix at both the start and the end in the code?

    Please Login or Register  to view this content.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Unable to detect CSV file.

    JapanDave,

    The reason is that Excel files come in more formats than just .xls. For example, they can be .xlsx or .xlsm. If you only searched for *.xls, you would miss those other kinds of Excel files. The .csv files on the other hand are only .csv with no variation, so there's no need to search for different kinds of extensions.

    ~tigeravatar

  5. #5
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Unable to detect CSV file.

    Thanks , that really helps a lot.

+ 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