View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen[_2_] Per Jessen[_2_] is offline
external usenet poster
 
Posts: 703
Default Name a File via Code Q

Hi

Try this:

TempFileName = "Part of " & Left(SourceWb.Name, Len(SourceWb.Name) -
4) & " " & Format(Now, "dd-mmm- yy h-mm") & "~"

Regards,
Per

On 7 Feb., 14:06, Seanie wrote:
I have a file that I create from a source document and name the file
basd on below. Which gives a new file name of "Part of name of
original file.xls 07-feb-09 1-30~.xls"

TempFileName = "Part of " & Sourcewb.Name & " " & Format(Now, "dd-mmm-
yy h-mm") & "~"

How could I exclude from the new file name the ext of the original
file? *(the first.xls in my example above)

eg. what I want to appear is "Part of name of original file 07-feb-09
1-30~.xls