change filename

R

rob

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
 
J

Joel

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)
 
R

rob

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top