Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Janis, I consulted with a MAC user and determined the following code will do
as you asked. It adds the time and removes the double.xls at the end. MAC doesn't care about the /'s in the date, as Windows does, so I left those alone. The colons in TIME had to go with either OS, so it is re-formatted with dot separators. Finally MAC appends the file extension for you, so I removed it from the code and let MAC do it's thing when the file is saved. Sub SaveMe() Dim fName As String Dim myFileName As String Const fPath As String = "Mac OS X:Users:jrough:Documents:" myFileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) _ & " " & Date & " " & Format(Time, "hh.mm.ss") fName = fPath & myFileName ActiveWorkbook.SaveAs Filename:=fName End Sub Mike F "Janis" wrote in message ... It is really tricky. The .xls extension saves twice and I can't get it to print the time and the date but it now compiles. Thanks, "Mike Fogleman" wrote: Sorry, word wrap cut my long line Sub SaveMe() Dim fName As String Dim myFileName As String Const fPath As String = "Mac OS X:Users:jrough:Documents:" myFileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) _ & " " & Date & ".xls" fName = fPath & myFileName ActiveWorkbook.SaveAs Filename:=fName End Sub Mike F "Janis" wrote in message ... The myFileName line does not compile. What I want to do here is save the current filename with the date appended. I am trying to put the current filename into the Sub tnx, saveIndesign() 'Appends date to filename so as to not write over an existing file Const fPath As String = "Mac OS X:Users:jrough:Documents" Dim fName As String Dim myFileName As String myFileName = ActiveWorkbook.Filename fName = fPath & myFileName & Time() ActiveWorkbook.SaveAs Filename:=fName End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I display the current XLS filename in a toolbar? | Excel Discussion (Misc queries) | |||
Converting a Variable Filename to a Constant Filename | Excel Programming | |||
Filename with current Date() | Excel Programming | |||
Filename with current Date() | Excel Programming | |||
Append current date to filename | Excel Programming |