+ Reply to Thread
Results 1 to 12 of 12

open a file named with space

  1. #1
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    open a file named with space

    Hi all,

    How could I open a file named with space in a specified path ?
    Path : "C:\Documents and Settings\"
    Filename : "Finance Budget 2014"

    There are several xls files in the folder
    Marketing Budget 2014
    Finance Budget 2014
    miscellaneous 2014

    What I would like to open is those files with "Budget".
    This is what I coded so far, but this is not working
    Please Login or Register  to view this content.
    Could anyone help me please? Thanks
    Last edited by lubbamkt; 05-05-2014 at 02:37 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,624

    Re: open a file named with space

    To insert the actual code, click the # icon, then paste your code lines between the [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags that appear. Please copy and paste from the VB editor itself.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: open a file named with space

    Could anyone help please?

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: open a file named with space

    It's not clear for me, do you want open all the files with budget ? only one ?
    If solved remember to mark Thread as solved

  5. #5
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: open a file named with space

    Quote Originally Posted by patel45 View Post
    It's not clear for me, do you want open all the files with budget ? only one ?
    I would like to open ALL files with the word "Budget". Thanks

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: open a file named with space


    Hi,

    try Dir("C:\Documents and Settings\*Budget*.xls")

  7. #7
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: open a file named with space

    Quote Originally Posted by Marc L View Post

    Hi,

    try Dir("C:\Documents and Settings\*Budget*.xls")
    Hi Marc L,

    It does not work. I guess I miss something on the first word in the file name (i.e. Marketing and Finance)

  8. #8
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: open a file named with space

    Please help

  9. #9
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: open a file named with space

    Please Login or Register  to view this content.
    Last edited by patel45; 05-05-2014 at 08:45 AM.

  10. #10
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: open a file named with space

    Same but different..

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: open a file named with space

    Quote Originally Posted by patel45 View Post
    Please Login or Register  to view this content.
    thank you so much

  12. #12
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: open a file named with space

    Quote Originally Posted by apo View Post
    Same but different..

    Please Login or Register  to view this content.
    thank you so much

+ 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] open variably named file, copy/paste data into consolidation file, open next file in list
    By sllawrence1968 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 09:49 PM
  2. Macro to open same named file from different folder
    By mrvindu in forum Excel General
    Replies: 0
    Last Post: 02-25-2011, 03:37 PM
  3. Open Variably-named File
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2010, 12:28 PM
  4. Open space delimited text file and transpose
    By bahgia in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-13-2010, 11:32 AM
  5. How do I open a file from a named cell?
    By Cumberland in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-23-2006, 04:15 AM

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