PDA

View Full Version : Saving file with new name



allison
02-19-2008, 02:19 PM
I've gotten this to work, but it seems to take longer than I expected to execute. Is there something that I can do to make it run quicker?

Sub Save()
Dim newFile As String
Dim faName As String
Dim fbName As String

Application.ScreenUpdating = False

faName = Range("H2").Value
fbName = Range("H4").Value

newFile = Format$(Date, "YYYYMMDD") & " " & faName & " " & fbName

ChDir "E:\"
ActiveWorkbook.SaveAs Filename:=newFile

MsgBox ("Review logged as " & newFile)

Application.ScreenUpdating = True

End Sub

Bob Phillips
02-19-2008, 02:29 PM
If it's a big file it will take a long time. Is it?

mdmackillop
02-19-2008, 02:30 PM
Try

ActiveWorkbook.SaveAs Filename:="E:\" & newFile

allison
02-19-2008, 02:32 PM
the template is 145 kb...

jamward
02-27-2008, 11:13 AM
just a thought. i have had issues with run speeds when changing directories to mapped drives on a WAN or LAN. If E:\ drive is a mapped drive maybe hardcoding folder location would help?? i.e. ActiveWorkbook.SaveAs Filename:="\\FolderName\Sub-FolderName\etc.\etc." & newFileIf drive E:\ is hardware on your computer, all of this is irrelavent.