+ Reply to Thread
Results 1 to 6 of 6

The use of wildcards in excel file names in VBA

  1. #1
    Registered User
    Join Date
    11-17-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    69

    The use of wildcards in excel file names in VBA

    Good evening, the code below relates to the opening of a file with a value specified in the
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    The above macro opens a file and retrieves information from it, the idea is for the code below to then go and close that file.

    Please Login or Register  to view this content.
    The problem I am having is that the above code returns the message "Compile Error: Expected: list separator or )"
    I am obviously not placing a "&" in the right place. Any assistance would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: The use of wildcards in excel file names in VBA

    You could put the spring
    Please Login or Register  to view this content.
    in a variable and watch it.
    What do you want to put before
    Please Login or Register  to view this content.
    Just "
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: The use of wildcards in excel file names in VBA

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Registered User
    Join Date
    11-17-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: The use of wildcards in excel file names in VBA

    Thank you so much for that, I can see quite clearly what your logic is and I should have seen it myself. All it takes sometimes is for someone else to point it out. Have a lovely Christmas.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: The use of wildcards in excel file names in VBA

    Thank you and Happy new year
    Enjoy Excel

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: The use of wildcards in excel file names in VBA

    Glad to help and thanks fpr rep+.

+ 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. Wildcards in file name and/or directory to call up pdf
    By Bruceybizzit in forum Excel General
    Replies: 4
    Last Post: 11-07-2018, 02:41 PM
  2. Deleting wildcards from names at once
    By miles44 in forum Excel General
    Replies: 4
    Last Post: 07-13-2018, 04:06 PM
  3. Check the file size using wildcards in VBA
    By dmccormick13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2012, 06:58 AM
  4. Replies: 15
    Last Post: 08-27-2012, 10:13 AM
  5. Wildcards in a File name
    By t0m46 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2010, 04:34 AM
  6. Search for a File using Wildcards
    By tsc35 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2009, 02:42 PM
  7. [SOLVED] file names in excel
    By TonyB in forum Excel General
    Replies: 2
    Last Post: 06-14-2005, 09:05 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