Results 1 to 7 of 7
  1. #1
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283

    .CSV file thinking it's .SLK Can't auto import

    Hello,



    I have .CSV files that think they are .SLK files and I cannot auto import them with my code. It's the way the files are exported out of the system. Does anyone know of a way I can import the files and fix this? I would appreciate it.

    Public Function GetFile() As Variant
    Dim dialog As Object
    Dim pickedfile As Boolean
    Set dialog = Application.FileDialog(3)
    GetFile = Null
    With dialog
    .AllowMultiSelect = False
    .Title = "Please select file for import"
    .Filters.Clear
    .Filters.Add "Text Files", "*.TXT; *.CSV"
    pickedfile = False
    pickedfile = .Show
    If pickedfile Then
    GetFile = .SelectedItems.Item(1)
    End If
    End With

    End Function

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried using Excel to open them yet?

  3. #3
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Yea I can import it into excel and access manually..

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excel can export it as a CSV file.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If Access can import the file as an SLK file then how about adding:

    .Filters.Add "Text Files", "*.TXT; *.CSV; *.SLK;"

  6. #6
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    I tried that before and it didn't work..now I tried it again and it works..I must have misspelled something..THanks

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're very welcome. I marked the thread as Solved for you.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 34
    Last Post: 08-09-2017, 09:57 AM
  2. Replies: 1
    Last Post: 03-03-2017, 09:25 PM
  3. Replies: 2
    Last Post: 02-28-2017, 01:34 AM
  4. Replies: 3
    Last Post: 02-05-2014, 04:25 AM
  5. Import Excel file based on a date and time in file name
    By nhylan in forum Import/Export Data
    Replies: 4
    Last Post: 04-16-2013, 03:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums