+ Reply to Thread
Results 1 to 7 of 7

Can I Use Wild Cards?

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Can I Use Wild Cards?

    'I have a scheduling worksheet with command buttons for opening PDF drawings stored in a shared drive folder. I will always know the first 11 characters of the file name, but not the length or value of the rest. Folks have started adding descriptive text to the end of their file names for easier reference.
    Here is the code:

    Please Login or Register  to view this content.
    'ThisFile is the folder, ThatFile is the first 11 characters

    'Any help would be appreciated and Thanks
    Last edited by JBeaucaire; 12-14-2012 at 10:08 AM. Reason: Added code tags, as per forum rules. Don't forget!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Can I Use Wild Cards?

    So maybe:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Can I Use Wild Cards?

    Thanks for the help.
    I tried it, but it will not open the file. The file name is B636800AB12Bill.pdf. I will always know the first 11 characters and that it is a pdf document. I will not know the remaining characters or their length.
    Thanks again.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Can I Use Wild Cards?

    That is the syntax I use for opening files with wildcards. The * covers any number of characters between the known string and the .pdf.

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Can I Use Wild Cards?

    Could the format of the cell have some impact?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Can I Use Wild Cards?

    1) ThisFile needs to end in \
    2) Let's pull the filename in from the Windows directory before we try to open it.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-12-2012
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Can I Use Wild Cards?

    Thanks for the tip on the \

    I could not get it to work, but came across another tip and adapted it to my needs. All is well. I do wish to be able to include something to look in Subfolders. The files could be in the main folder or a couple of subfolders. This code looks in a particular folder following the hyperlink. Thank you again for your assistance.

    Please Login or Register  to view this content.
    Last edited by rblassit; 12-16-2012 at 11:54 AM. Reason: Miss spelled a word

+ 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