View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default How to pass unique custom file name to Save Dialog

You can use the SaveAs method and set your file name up as a combination of
User Name, topic and date. You and use the InputBox method to get the user
name as a variable and use the format function to set the date as a string.

userName = InputBox("Enter your name (1st or last?)", "User Name"
fName = userName & Format(Now, "dmmmyy") & "Topic"
wb.SaveAs fileName:=fName

"ExcelQ" wrote:

I have an Excel template and when the user saves his workfile, I would like
to generate an unique file and pass it to the save dialog. Any help is
appreciated.