View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
galimi[_2_] galimi[_2_] is offline
external usenet poster
 
Posts: 65
Default Saving to users My Documents

Rob,

You can determine the username path from one of the environment variables.
You can cycle through them with the following code:

Sub allEnviron()
z = 1
doagain:
On Error GoTo Quitapp
Debug.Print Environ(z) & " : # " & z
z = z + 1
GoTo doagain
Quitapp:
End Sub

http://HelpExcel.com

"Rob Edwards" wrote:

Hi,
When creating code to save a file, how do you specify a users 'My
Documents' folder so that it is determined at run time. Therefore,
dependent on the user, the file will be saved in their C:\Documents and
Settings\'user'\My Documents\, i.e. in my case... C:\Documents and
Settings\REdwards68584\My Documents\

I'm sure it must be easy!

Thanks in advance.

Rob

Rob Edwards

07092 108121

*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!