Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default change filename

I am looking to some VBA script to change the filename BUT without saving at
that moment.

workbook.Saveas can be used but this also saves the file.

I would like to have the generated name displayed as default filename when
the user wants to saveas the excel sheet. (and not the name as it was opened
with)

regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default change filename

You have to perform the saveas to get the window name to change. The best
way to do what you want is to open a dialog box using the GetSaveAsfilename
method and put the default name in as the Initialfilename. After the user
selects the filename, then do a SaveAS. Do this at the beginning of the
macro and then perform all your other operations and then do another Save at
the end of the changes.

application.GetSaveAsFilename(InitialFilename, FileFilter, FilterIndex,
Title, ButtonText)


"rob" wrote:

I am looking to some VBA script to change the filename BUT without saving at
that moment.

workbook.Saveas can be used but this also saves the file.

I would like to have the generated name displayed as default filename when
the user wants to saveas the excel sheet. (and not the name as it was opened
with)

regards

  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default change filename

I just do not want the user interaction.

The filename is created based on the output of macro calculation.
But I do not want to save the file at this moment.

rob

"Joel" wrote:

You have to perform the saveas to get the window name to change. The best
way to do what you want is to open a dialog box using the GetSaveAsfilename
method and put the default name in as the Initialfilename. After the user
selects the filename, then do a SaveAS. Do this at the beginning of the
macro and then perform all your other operations and then do another Save at
the end of the changes.

application.GetSaveAsFilename(InitialFilename, FileFilter, FilterIndex,
Title, ButtonText)


"rob" wrote:

I am looking to some VBA script to change the filename BUT without saving at
that moment.

workbook.Saveas can be used but this also saves the file.

I would like to have the generated name displayed as default filename when
the user wants to saveas the excel sheet. (and not the name as it was opened
with)

regards

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
Change Filename in Macro Havenstar Excel Discussion (Misc queries) 3 January 16th 09 05:27 PM
Change filename & auto_open cottage6 Excel Programming 2 September 25th 07 01:32 PM
Change hardcoded filename CLR Excel Programming 6 August 29th 06 05:21 PM
script to change filename jeramie[_2_] Excel Programming 2 February 11th 06 09:36 PM
Change Filename Planner Excel Programming 3 August 11th 04 03:43 PM


All times are GMT +1. The time now is 12:09 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"