View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
BrianB BrianB is offline
external usenet poster
 
Posts: 109
Default saving new file name

Is this what you want ? (will need to be adapted. might need full path)

'==================================
Sub UnTested()
Dim OldName As String
Dim NewName As String
OldName = ActiveWorkbook.Name
NewName = Worksheets("Sheet1").Value
'- make new file
ActiveWorkbook.SaveAs FileName:=NewName
'- delete old file
Kill OldName
End Sub
'==============================================


Regards
BrianB
-------------------------------------



Douvid wrote in message ...
Hi ,
I need to save an open file under a new name by replacing the old one.
The problem is that the new name is generated by the content of the file, I mean that the file is open.
Does someone has a good idea.

cheers,
Douvid