Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Specify a default file name in VB when the Save / Save As command.

Hello,

I would like to specify a default file name when a user selects either the
Save or Save As commands from the Menu bar in excel.

I have thought about inserting a button on the excel spreadsheet and using
VB to load the Save / SaveAs dialog box, but this would mean disabling the
normal Save / Save As menu command buttons.

The default File name would include a static name XXX followed by todays date.

Any advise would be greatly apprieciated.

Many Thanks

SM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Specify a default file name in VB when the Save / Save As command.

If you want to control the name assigned to the file, then you will need to
provide the interface with the user.

sName = Application.GetSaveAsFilename( InitialFilename:="XXX" &
format(date,"yyyymmdd") & ".xls")

sName will contain the fully qualified path the user had chosen, but
getsaveasfilename does not save the file. You can then save it with

Activeworkbook.SaveAs sName

But if you already know what the name should be, why involve the user. Why
not just save the file with that name.

--
Regards,
Tom Ogilvy

"SMAN" wrote in message
...
Hello,

I would like to specify a default file name when a user selects either the
Save or Save As commands from the Menu bar in excel.

I have thought about inserting a button on the excel spreadsheet and using
VB to load the Save / SaveAs dialog box, but this would mean disabling the
normal Save / Save As menu command buttons.

The default File name would include a static name XXX followed by todays

date.

Any advise would be greatly apprieciated.

Many Thanks

SM



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
Can I disable the Save command for an Excel file? Frali Excel Discussion (Misc queries) 1 September 14th 07 08:43 PM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
How do I set the save default not to include .xls in name of file Sue Excel Discussion (Misc queries) 1 September 13th 06 08:52 PM
"Save As" default is a .txt file Chesster Excel Discussion (Misc queries) 1 July 25th 05 03:36 PM
can i save an existing .xls file as a .csv file using command line craigkan Excel Discussion (Misc queries) 2 February 18th 05 02:01 PM


All times are GMT +1. The time now is 02:40 PM.

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

About Us

"It's about Microsoft Excel"