+ Reply to Thread
Results 1 to 2 of 2

Import multiple text files via MultiSelect

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,141

    Import multiple text files via MultiSelect

    I am trying to import mutliple text files (User selected) and append them to a single worksheet.
    I am stumbling on the use of "MultiSelect:=True" during import.
    Adding MultiSelect:=True to my code causes a routine to fail.
    Run-time 13 Type mismatch

    Removing the code for MultiSelect and it will run for a single file.

    Please Login or Register  to view this content.
    Any help, hints or tips is appreciated.
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Import multiple text files via MultiSelect

    Good morning Rick_Stanich

    OK. You seem to be trying to treat the variable fname2 as just that : a variable

    In using MultiSelect, you have effectively changed fname2 from a simple one dimensioned variable into an array - there will thus be a fname(1), fname(2), maybe an fname(3) etc - depends on how many files one selects. This is why the routine fails, not the fact that you have introduced MultiSelect.

    Try running this routine which will bring up your dialog, and then list the files selected in a MsgBox one at a time :
    Please Login or Register  to view this content.
    HTH

    DominicB

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Import multiple text files into excel
    By bginsberg in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-20-2013, 04:05 PM
  2. Macro to Parse Text - Import text to Excel from Multiple Text Files & Folders
    By Novice_To_Excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2012, 01:05 AM
  3. [SOLVED] Import multiple text files to 1 column
    By vbarookie_1000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2012, 02:55 PM
  4. using MS Query to import multiple text files
    By John99 in forum Excel General
    Replies: 1
    Last Post: 10-26-2009, 08:27 PM
  5. Import of Multiple Text Files
    By yanks6rule in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2006, 07:34 PM

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