none
Path of a file and VBA RRS feed

  • Question

  • Hi,

    My VBA proc is searching a project file .mpp. This file is on a network directory, and the proc don't find the file (Compilation Error)

    Is there any limit in number of characters?

    Are spaces and "-" accepted in such paths?

    Does a path can start with "\\" or does it need a letter of drive?

    Thanks for your help



    • Edited by WLID1966 Wednesday, March 27, 2019 5:00 PM
    Wednesday, March 27, 2019 4:39 PM

Answers

  • WLID1966,

    As far as I know, the max number of characters in each component of the path is 255. The total path length can be much larger. If you exceed the path length, you should get an alert telling you so.

    A server path starts with "\\" and does not need a drive letter. Also, "-" is a valid character in a path string. For example, this file is located on my spare hard drive.

    \\Mac\Spare HD\StaticMstr - 21-9-2016.mpp

    Hope this helps.

    John


    • Edited by John - Project Wednesday, March 27, 2019 5:22 PM path length
    • Marked as answer by WLID1966 Wednesday, March 27, 2019 8:55 PM
    Wednesday, March 27, 2019 5:17 PM

All replies

  • WLID1966,

    As far as I know, the max number of characters in each component of the path is 255. The total path length can be much larger. If you exceed the path length, you should get an alert telling you so.

    A server path starts with "\\" and does not need a drive letter. Also, "-" is a valid character in a path string. For example, this file is located on my spare hard drive.

    \\Mac\Spare HD\StaticMstr - 21-9-2016.mpp

    Hope this helps.

    John


    • Edited by John - Project Wednesday, March 27, 2019 5:22 PM path length
    • Marked as answer by WLID1966 Wednesday, March 27, 2019 8:55 PM
    Wednesday, March 27, 2019 5:17 PM
  • Thanks a lot John!
    Wednesday, March 27, 2019 8:55 PM
  • WLID1966,

    You're welcome and thanks for the feedback.

    John

    Thursday, March 28, 2019 1:31 AM