Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Feb 2004
    Location
    Houston, Texas, USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change Directory (VBA/MS Project 2003/SR-1)

    I have written some code that works well except that it continues to insert files from a different directory than the one that I want to use. (The files have the same names in different directories, for different weeks of the year). I've placed my base project file in which I want to consolidate the projects inside the directory that I want to use; however the problem continues. Do I need to change the directory inside the code? I had assumed that as long as the base project file was in the directory with the files that I wanted, it would default to them. My code currently does not contain a directory path, only the file names.

    Thanks,

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Directory (VBA/MS Project 2003/SR-1)

    I don't know MSProject, and you didn't include your VBA code so I can't see how you are inserting those files, so this is just a guess based on my knowledge of VBA. If you use VBA to open a file and don't specify a directory, it defaults to whatever the current directory is. If you are using some method from the MSProject object model, then the directory will be whatever that method defaults to. From your description of the results, it would be reasonable to guess that you need to either specify a path with the file name, or use the CHDIR function to change the current directory before "inserting" the file.
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •