+ Reply to Thread
Results 1 to 2 of 2

Opening other fiels in same folder

  1. #1
    Registered User
    Join Date
    04-21-2009
    Location
    Nottingham
    MS-Off Ver
    Excel 2003
    Posts
    66

    Opening other fiels in same folder

    Hello, I have a master sheet (Called daily report) which has a macro to call other excel sheets to open within the same folder.

    The folder is on a shared directory (P for me) and the problem i have is that the letter of the directory is different on other people's computers.

    Is there a better way of coding the below so the macro will work without having to state the folder directory letter?

    By the way, this is just the beginning of the macro - the remainder is irrevlevant to my request.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Opening other fiels in same folder

    There are a couple of things I can think of. The easiest and most reliable would be to use an .inputbox to have a user type in the drive letter or an application.getopenfilename to select the first file, then get the drive and folder name from that.

    If that is not an option, the below code will go through each drive A:\ to Z:\ and search for the first file you list in your code above. Once found, it will make the variable strFound equal to that DRIVE (ex: P:\)

    Please Login or Register  to view this content.
    After putting this code first, you'd have to alter the rest of your code to use strFound:

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

+ 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