Yes, that's what I was planning. So now I guess I need a VBA function:
Code:
Public Function GetEnviron(EnvVariable As String) As String
GetEnviron = Environ(EnvVariable)
End Function
Then I need to have a line in my macro:
SetTempVar
Variable: MyFolder
Expression: GetEnviron("userprofile") & "\My Documents\SubFolder"
Then the TempVar MyFolder contains:
"C:\Users\name\My Documents\SubFolder" in Win7, and
"C:\Documents and Settings\name\My Documents\SubFolder" in XP.
This works in both OS's. I was just hoping to not need the VBA function.
Please tell me why you think the Environ function is not dependable.
Thanks...