Place Username In Directory Path

  • 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:





    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?

  • Re: Place Username In Directory Path


    Hi


    if I understand you correctly, replace


    Code
    "C:\Documents and Settings\XXXXXX\My Documents\Salary Review Data 2007 - " & country & ".xls" _


    with


    Code
    "C:\Documents and Settings\" & User & "\My Documents\Salary Review Data 2007 - " & country & ".xls" _


    Robert

  • Re: Place Username In Directory Path


    It didn't work at first, but i figured out that when i passed the value of the username to 'user' my cell wasn't actually selected.


    This works now. Thanks.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!