+ Reply to Thread
Results 1 to 6 of 6

Wildcard or "Begins With" in a Workbooks.open filename directory?

  1. #1
    Registered User
    Join Date
    08-23-2007
    Posts
    19

    Wildcard or "Begins With" in a Workbooks.open filename directory?

    Hi this is quite similar to a question I posed earlier but managed to find a workaround. If I am trying to open a file but only have the beginning of one part of the directory can I use a wildcard or a "Begins With"??

    Here is the current code. The sub directory of 'CIVILS WORKS' begins with the jobno variable but sometimes has additional text after the jobno.

    Please Login or Register  to view this content.
    It's not as simple as adding a *. Is there a simple way?

    Edit: Typo
    Last edited by Fazered; 08-23-2007 at 03:29 PM.

  2. #2
    Registered User
    Join Date
    08-23-2007
    Posts
    19
    To add if there isn't a simple way could I perhaps do a "dir" get the full folder name and assign it as a variable to use in the directory name?

  3. #3
    Registered User
    Join Date
    08-23-2007
    Posts
    19
    Anyone?

    Anybody have any solution at all?

  4. #4
    Registered User
    Join Date
    08-23-2007
    Posts
    19
    Well I did it myself again, in case anyone else has the same problem. I did a workaround with dir. Still don't know if there is a way to use wildcards with fileopen.

    You have to get dir to look for directories using "vbdirectory" which got me for ages.

    Please Login or Register  to view this content.
    I didn't need to but if you wanted to open up files in all the directories you could set "Job_dir = dir" which automatically gives the next matching directory and then loop back while dir <> = ""

  5. #5
    Registered User
    Join Date
    08-23-2007
    Posts
    19
    Damn it. All's fine unless there is a file that also starts the same.

    Got this code from ther help that I thought would work but GetAttr won't accept a damn waildcard! Back where I started.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-23-2007
    Posts
    19
    I take it back. I didn't need to have the wildcard in there so it worked! It's a whole lot more code than I expected but it does work.

    Well it's been lovely chatting to you Fazered. Thanks for your help.

+ 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