PC Review


Reply
Thread Tools Rate Thread

change filename

 
 
rob
Guest
Posts: n/a
 
      21st Dec 2008
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 With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      21st Dec 2008
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 With Quote
 
rob
Guest
Posts: n/a
 
      21st Dec 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change filename & auto_open =?Utf-8?B?Y290dGFnZTY=?= Microsoft Excel Programming 2 25th Sep 2007 01:32 PM
Re: Change filename Dmitry Streblechenko Microsoft Outlook VBA Programming 10 29th Mar 2007 09:24 PM
script to change filename =?Utf-8?B?amVyYW1pZQ==?= Microsoft Excel Programming 4 11th Feb 2006 09:36 PM
Change Filename Planner Microsoft Excel Programming 3 11th Aug 2004 03:43 PM
if you change a filename ... yeah I *know* that! John Windows XP General 2 7th Aug 2003 01:51 PM


Features
 

Advertising
 

Newsgroups
 


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