Results 1 to 10 of 10

Best way to obtain File name

Threaded View

LewisGoose Best way to obtain File name 06-22-2016, 01:05 PM
Norie Re: Best way to obtain File... 06-22-2016, 01:09 PM
shg Re: Best way to obtain File... 06-22-2016, 01:10 PM
Norie Re: Best way to obtain File... 06-22-2016, 01:15 PM
LewisGoose Re: Best way to obtain File... 06-22-2016, 01:16 PM
Norie Re: Best way to obtain File... 06-22-2016, 01:21 PM
LewisGoose Re: Best way to obtain File... 06-22-2016, 01:34 PM
Norie Re: Best way to obtain File... 06-22-2016, 01:37 PM
LewisGoose Re: Best way to obtain File... 06-22-2016, 01:47 PM
Norie Re: Best way to obtain File... 06-22-2016, 02:23 PM
  1. #1
    Registered User
    Join Date
    06-22-2016
    Location
    United States
    MS-Off Ver
    2003,2013
    Posts
    24

    Best way to obtain File name

    I am writing code that opens up other workbooks and copy/pastes the charts into my original workbook.

    Currently, my code looks like this

    Dim GrabFileLocation as String
    Dim MRB as String
    
    GrabFileLocation = Application.GetOpenFilename()
    MRB = Right(GrabFileLocation, 18)
    
    ' Open
    Workbooks.Open (MRB)
    This is problematic, as if the length of the file name ever changes, my macro won't be able tot open the file properly. Is there a better way to do this?

    My thought was, maybe theres some way to associate the file location with a wildcard, e.g.

    GrabFileLocation = C:\Users\LewisGoose\*
    where the wildcard is the file name, then I could say

    FileName = *
    where the wildcard is the EXACT wildcard from GrabFileLocation.




    This is just a thought on how to best call a filename. If anyone has a better idea, please let me know. Thanks!
    Last edited by LewisGoose; 06-22-2016 at 01:47 PM. Reason: mark as solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Is it possible obtain xlsxm from exe file ?
    By misalspi in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 02-03-2013, 04:15 AM
  2. Obtain file extension
    By Jacques Grobler in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2010, 03:05 AM
  3. Browse Button Code to obtain single file name
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-29-2009, 05:34 AM
  4. Product key but no cd - how do i obtain new cd?
    By Joe Miller in forum Excel General
    Replies: 4
    Last Post: 11-25-2008, 08:47 AM
  5. Obtain All File names in a folder
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2008, 08:25 AM
  6. Replies: 1
    Last Post: 06-02-2006, 02:48 PM
  7. how do i obtain a file name from a cell contents and use it to sa.
    By Paul Bond in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2006, 06:10 PM
  8. Obtain imported file modified date
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2006, 01:15 PM

Tags for this Thread

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