+ Reply to Thread
Results 1 to 4 of 4

FileDialog to Import XLS Content

  1. #1
    Registered User
    Join Date
    10-24-2010
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    2

    FileDialog to Import XLS Content

    I am trying to use a FileDialog(msoFileDialogFilePicker) dialog box to import either delimited text from a file, or content from a XLS sheet (all cells from the first worksheet). I have the delimited-import part working, but I am unable to get the XLS import to work.

    My code is attachd. Any input is appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: FileDialog to Import XLS Content

    Welcome to the forum!

    In the second QueryTables.Add, change Connection:="TEXT;" to Connection:="ODBC;" and see if that helps.
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

  3. #3
    Registered User
    Join Date
    10-24-2010
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: FileDialog to Import XLS Content

    I appreciate the ODBC idea, but still no data unfortunately.


    Any other input is appreciated.

  4. #4
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: FileDialog to Import XLS Content

    I recorded the following macro by selecting Data->Import External Data->Import Data..., then selecting an Excel file and then Sheet1. This shows what things you need to specify in the ODBC connection string.
    Please Login or Register  to view this content.
    I suggest you record what you want to have happen and then adapt it to your needs.

+ 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