RyanT
07-13-2008, 10:24 PM
Don?t want to hard code my output path since not everyone uses the default My Docs location. i would like to save a file in My Docs\time sheets\xxx.xls regardless of where the user?s my docs might be. Is there a simple way to do this. Something like: %docs%\time sheets\
Right now I have a text box (txtPath) where the user can enter the path they want but the problem is if the user sync?s the xls files between 2 computers with different My Docs locations
Dim FileName As String, WeekNumber As String, MyName As String
WeekNumber = Range("A1").Value
MyName = Range("A29").Value
FileName = "Time Sheet " & MyName & " - Week Ending " & Format$(Range("W5").Value, "yyyy-mm-dd")
ChDir _
txtPath.Value
ActiveWorkbook.SaveAs FileName:=FileName
The other thing I could do would be to have the file save to the folder that the file was opened from.
Sorry about the dumb questions, I haven?t touched vb6 in over 6 years.
Thanks for the help
Right now I have a text box (txtPath) where the user can enter the path they want but the problem is if the user sync?s the xls files between 2 computers with different My Docs locations
Dim FileName As String, WeekNumber As String, MyName As String
WeekNumber = Range("A1").Value
MyName = Range("A29").Value
FileName = "Time Sheet " & MyName & " - Week Ending " & Format$(Range("W5").Value, "yyyy-mm-dd")
ChDir _
txtPath.Value
ActiveWorkbook.SaveAs FileName:=FileName
The other thing I could do would be to have the file save to the folder that the file was opened from.
Sorry about the dumb questions, I haven?t touched vb6 in over 6 years.
Thanks for the help