+ Reply to Thread
Results 1 to 4 of 4

Opening files with a filebrowser

  1. #1
    Registered User
    Join Date
    04-18-2007
    Posts
    47

    Opening files with a filebrowser

    Hi,

    Does anybody know how to write an "import data" script where the users would select files with a File -> Open interface? thanks!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello MasterMonk,

    Do you want the user to select files from the "Open" dialog and then import the file (assuming it is text) into a Workbook?

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    04-18-2007
    Posts
    47
    Leith

    Actually I didn't want to complicate the question too much, but there are 6 files that they need to select and import into separate workbooks. The import part I have under control.

    I just want to know how to create the "browse for files"-type interface that will return the path of the files to be imported into a text box.

    Andy

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Andy,

    This code will bring up the "Open" dialog in the directory of your choice. The user can then select the file, and the dialog will return the user's choice as string. Just set the variable "MyDirectory" to the folder that contains the file. Be sure to use the full folder path. If the user Cancels a message box is display to tell you that. The function returns either the ful path of the file or an empty string.

    Please Login or Register  to view this content.
    Calling Example:
    ImportFileName = SelectFile

    Sincerely,
    Leith Ross

+ 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