Export spreadsheet to %userprofile%\My Documents

N

Nick X

Hello All,
I want to export a query using code. I have the code working as long as I
have this path:
conPath = "C:\Documents and Settings\(myusername)\My
Documents\Billing_Backup\"

Since this is a database that I am only updating the structure on I would
like to be able to have a generic path such as:

conPath = "C:\Documents and Settings\%userprofile%\My
Documents\Billing_Backup\"

This is so I do not have change the path every time I update the user's
front end.

Any help would be greatly appreciated.

Thanks
 
N

Nick X

Thank you very much. After scratching my head for a while trying to figure
out how to fit it into my "Sub" (most of my experience with coding has been
trial and error) and working it to where I wasn't repeating the path that
this function calls; it works wonderfully.

Thank you for making me think!
 
Top