Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
After doing some processing on a file I want to save it back to My
Documents with a new file name. I currrently have the following code: strFilename = Title & " " & Format(Now(), "yyyymmdd") & " " & Format(Now(), "hhmm") & ".xls" MsgBox "Filename is " & strFilename ActiveWorkbook.SaveAs strFilename It appears that without specifiying a path name the file gets saved in My Documents with the value of the string "Title" and the date/time stamp added but I want to be more explicit on the path. When I change the first line of code above to: strFilename = "C:\My Documents\" & Title & " " & Format(Now(), "yyyymmdd") & " " & Format(Now(), "hhmm") & ".xls" the save as fails with the error of not finding the path. If I change the line to: strFilename = "C:\" & Title & " " & Format(Now(), "yyyymmdd") & " " & Format(Now(), "hhmm") & ".xls" the file is saved to the root on C: correctly. Any ideas on why I can't explicitly save to My Documents? And, am I correct that if I don't specify a path it will default to My Documents? John Keith |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I change default file for saving documents? | Excel Discussion (Misc queries) | |||
Problem with saving documents as .csv file | Excel Programming | |||
Saving Excel File in Current Directory NOT My Documents | Excel Programming | |||
Saving Excel File in Current Directory NOT My Documents | Excel Programming | |||
cannot open documents as viruscan says problem file? | Excel Discussion (Misc queries) |