+ Reply to Thread
Results 1 to 2 of 2

Store Selected FilePath Without Opening File

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    41

    Store Selected FilePath Without Opening File

    I want to be able to have user select file and then have the filepath selected stored in a variable without actually opening the file. I am trying to use a global String and I get type mismatch error when trying to set value of enr1.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,283

    Re: Store Selected FilePath Without Opening File

    You use Set for an Object, not a String. take it out.

    But, if you select multiple files in the file dialogue box, you're just going to keep over-writing the fileSelected global variable.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. [SOLVED] MACRO: Store name of selected file as string w/ import data file dialog box
    By AnnieMcken in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2013, 02:13 PM
  2. [SOLVED] Trying to get the filepath on "Open", but get filepath of a temporary file instead
    By ianpwilliams in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-22-2013, 12:27 AM
  3. [SOLVED] Copying files from a selected filepath to a filepath mentioned in a worksheet's cell
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2012, 03:59 PM
  4. VBA- Opening a new workbook based on filepath in Cell
    By jackb1117 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2009, 04:23 PM
  5. Store FilePath Inside Code
    By Magnivy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2006, 05:10 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