Hi. I've been trying to get the network username and found the solution on a previous thread. I have got to the point where I have copied the network username to my workbook. I now want to save this workbook into My Documents using that value for the username. So, so far i have:
Code
'Get username from network
Dim User As String
CUser = Environ("username")
Cells(5000, 9) = Environ("username")
user = Application.ActiveCell
'Protect workbook and save in My Documents
ActiveSheet.Protect
ChDir "C:\Documents and Settings\XXXXXXX\My Documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\XXXXXX\My Documents\Salary Review Data 2007 - " & country & ".xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Display More
The user who saves this workbook, will be doing so on their own PC's so i need the file to save to their 'My Documents' folder. So i need to replace the red X's with the user's network username (which I have extracted and dim'd as User. How do i write this into the path of the directory?