I am writing a tool that generates a file from Excel using VBA. The generated file is written to the folder, if it exists, in the "User Documents" folder.
eg. C:\Users\<username>\Documents\Some Folder\
If the last folder does not exist, then VBA creates it. I use the following line to make sure the folder location works for different Windows users distributed in the organization:
If Len(Dir(Environ("USERPROFILE") & "\Documents\Some Folder", vbDirectory)) = 0 Then
MkDir Environ("USERPROFILE") & "\Documents\Some Folder"
End If
Open Environ("USERPROFILE") & "\Documents\Some Folder\" & "file.php" For Output As #1
Print #1, output
Close
Now my problem is that I also have to serve Mac OSX users. I currently do not have access to a Mac for testing, but I assume that the above will not work.
What can I use to specify subfolders in user documents and how to include code that conditionally uses the Windows line or the Mac line?