+ Reply to Thread
Results 1 to 7 of 7

How to open a changing file (weekly)

  1. #1
    Registered User
    Join Date
    12-09-2012
    Location
    riyadh
    MS-Off Ver
    Excel 2007
    Posts
    4

    How to open a changing file (weekly)

    example code:

    Set wbopen = Workbooks.Open _
    ("\\It-data-share\ENGINEERING\Projects\MOI Projects\xMOI PROJECT GENERAL FOLDER\ROHN ARABIA PROJECT MANAGER MASTER SITE LIST - 9-12-2012.xlsm")

    that 9-12-2012 after "LIST -" is changable.
    and the date for is d-mm-yyyy

    that file is need to be open week using my macro that gets some of the data insde.

    is there anyway to call that file name even if it is changable weekly ??

    thanks,

    fucell

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: How to open a changing file (weekly)

    If there is a rule that is used to choose the filename then this is possible. You would need to advise what that rule is.

    A simple alternative is to always use the same file name for the latest version and change it when it is superceded. For example, the filename might be...

    ROHN ARABIA PROJECT MANAGER MASTER SITE LIST - LATEST.xlsm
    Martin

  3. #3
    Registered User
    Join Date
    12-09-2012
    Location
    riyadh
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to open a changing file (weekly)

    thank you for your suggestion sir, but unfortunately, im not the only one whos updating it so we agreed that we should put a date on the last section of a file name which - dd-mm-yyyy. is there anyway to call that file name even if it changeable weekly?

    thank you

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: How to open a changing file (weekly)

    Try this function

    Please Login or Register  to view this content.
    This is called like this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-09-2012
    Location
    riyadh
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to open a changing file (weekly)

    thanks you mrice ^__^

    but im having a problem... i cant call or use the function. this is my whole code can you check please... i put them in one module.

    if you can see, im assuming that "FileName" was already stored the current filename of the excel file.. am i doing right ?

    Please Login or Register  to view this content.
    thanks in advance.

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: How to open a changing file (weekly)

    Can you try

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-09-2012
    Location
    riyadh
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to open a changing file (weekly)

    thank you mRice!! it works.. 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)

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