If Mac or If PC. RRS feed

  • Question

  • I have a drive that is mapped on my Mac and my PC, the Mac it shows up as /Volumes/Images/ on the PC it shows S:/Images/

    I am trying to make it so that I can use the same line of code in Excel, between both systems, and only change the path upon where a link will be pointing towards? 

    I've been looking online and coming up with multiple answers of how to do it, but I am looking for a more solid answer, and I thought the best place to ask would be the place in where the Excel program was made.

    Basically I want it to show if Mac = syspath = /Volumes/Images. if PC = syspath = S:/Images/

    Is this possible, if so how?

    Thanks in advance.

    Thursday, May 31, 2012 3:55 PM


  • I believe there's a built-in conditional comiler constant, "Mac", so you can code:
        #If Mac Then
            syspath = "/Volumes/Images/"
            syspath = "S:\Images\
        #End If

    • Marked as answer by Matt Ridge Friday, June 1, 2012 12:45 PM
    Thursday, May 31, 2012 5:37 PM