Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to pass unique custom file name to Save Dialog

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

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

You will need to add the file extension (.xls, .xlc, etc.) to your 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How to pass unique custom file name to Save Dialog

Or you could use this:

Set NewBook = Workbooks.Add
fName = Application.GetSaveAsFilename
NewBook.SaveAs Filename:=fName

which adds a new workbook and then displays the SaveAs Dialog Box so you can
enter any file name you like and choose the type file extension.


"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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save file dialog box in Excel falcios Excel Discussion (Misc queries) 4 February 12th 07 08:29 PM
How to set file Filter in Save dialog box sreenath205 Excel Programming 1 July 31st 06 01:49 PM
Help with custom save as dialog box. control freak Excel Discussion (Misc queries) 0 July 21st 06 03:23 PM
How do you disable save file dialog? someone Setting up and Configuration of Excel 2 February 13th 05 12:02 AM
Close file without Save Changes dialog box flumpf Excel Programming 1 October 24th 03 02:38 AM


All times are GMT +1. The time now is 11:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"