Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Ensuring File Name is Blank

I have the following code that is used to prompt a user to save the current
file:

fname = Application.GetSaveAsFilename(FileFilter:="Microso ft Excel Workbook
(*.xls), *.xls")

However, when the save menu pops up, it has the current name of the file in
the filename slot as a default. I want it to be blank tho, to force the user
to type in name. Does someone know how I can modify the above to do that?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Ensuring File Name is Blank

Paige:

If you try the help pages you can get a lot of information aboput the
functions.

For example the GetSaveAsFilename from the help page states:

Displays the standard Save As dialog box and gets a file name from the user
without actually saving any files.

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

expression Required. An expression that returns an Application object.

InitialFilename Optional Variant. Specifies the suggested file name. If
this argument is omitted, Microsoft Excel uses the active workbook's name.

FileFilter Optional Variant. A string specifying file filtering criteria.

This string consists of pairs of file filter strings followed by the MS-DOS
wildcard file filter specification, with each part and each pair separated by
commas. Each separate pair is listed in the Files of type drop-down list box.
For example, the following string specifies two file filters, text and addin:
"Text Files (*.txt), *.txt, Add-In Files (*.xla), *.xla".

To use multiple MS-DOS wildcard expressions for a single file filter type,
separate the wildcard expressions with semicolons; for example, "Visual Basic
Files (*.bas; *.txt),*.bas;*.txt".

If omitted, this argument defaults to "All Files (*.*),*.*".

FilterIndex Optional Variant. Specifies the index number of the default
file filtering criteria, from 1 to the number of filters specified in
FileFilter. If this argument is omitted or greater than the number of filters
present, the first file filter is used.

Title Optional Variant. Specifies the title of the dialog box. If this
argument is omitted, the default title is used.

ButtonText Optional Variant. Macintosh only.

And you can instantly see that you need to use:

InitialFilename as in:

fname = Application.GetSaveAsFilename( _
InitialFilename:="", _
FileFilter:="Microsoft Excel Workbook (*.xls), *.xls")

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Paige" wrote:

I have the following code that is used to prompt a user to save the current
file:

fname = Application.GetSaveAsFilename(FileFilter:="Microso ft Excel Workbook
(*.xls), *.xls")

However, when the save menu pops up, it has the current name of the file in
the filename slot as a default. I want it to be blank tho, to force the user
to type in name. Does someone know how I can modify the above to do that?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Ensuring File Name is Blank

DUH!!!! Thanks, Martin. I didn't have the Help feature installed; so
installed it, and guess what - it has a wealth of info. Appreciate your
sending me down the path of enlightenment!

"Martin Fishlock" wrote:

Paige:

If you try the help pages you can get a lot of information aboput the
functions.

For example the GetSaveAsFilename from the help page states:

Displays the standard Save As dialog box and gets a file name from the user
without actually saving any files.

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

expression Required. An expression that returns an Application object.

InitialFilename Optional Variant. Specifies the suggested file name. If
this argument is omitted, Microsoft Excel uses the active workbook's name.

FileFilter Optional Variant. A string specifying file filtering criteria.

This string consists of pairs of file filter strings followed by the MS-DOS
wildcard file filter specification, with each part and each pair separated by
commas. Each separate pair is listed in the Files of type drop-down list box.
For example, the following string specifies two file filters, text and addin:
"Text Files (*.txt), *.txt, Add-In Files (*.xla), *.xla".

To use multiple MS-DOS wildcard expressions for a single file filter type,
separate the wildcard expressions with semicolons; for example, "Visual Basic
Files (*.bas; *.txt),*.bas;*.txt".

If omitted, this argument defaults to "All Files (*.*),*.*".

FilterIndex Optional Variant. Specifies the index number of the default
file filtering criteria, from 1 to the number of filters specified in
FileFilter. If this argument is omitted or greater than the number of filters
present, the first file filter is used.

Title Optional Variant. Specifies the title of the dialog box. If this
argument is omitted, the default title is used.

ButtonText Optional Variant. Macintosh only.

And you can instantly see that you need to use:

InitialFilename as in:

fname = Application.GetSaveAsFilename( _
InitialFilename:="", _
FileFilter:="Microsoft Excel Workbook (*.xls), *.xls")

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Paige" wrote:

I have the following code that is used to prompt a user to save the current
file:

fname = Application.GetSaveAsFilename(FileFilter:="Microso ft Excel Workbook
(*.xls), *.xls")

However, when the save menu pops up, it has the current name of the file in
the filename slot as a default. I want it to be blank tho, to force the user
to type in name. Does someone know how I can modify the above to do that?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Ensuring File Name is Blank

Your are welcome.
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Paige" wrote:

DUH!!!! Thanks, Martin. I didn't have the Help feature installed; so
installed it, and guess what - it has a wealth of info. Appreciate your
sending me down the path of enlightenment!

"Martin Fishlock" wrote:

Paige:

If you try the help pages you can get a lot of information aboput the
functions.

For example the GetSaveAsFilename from the help page states:

Displays the standard Save As dialog box and gets a file name from the user
without actually saving any files.

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

expression Required. An expression that returns an Application object.

InitialFilename Optional Variant. Specifies the suggested file name. If
this argument is omitted, Microsoft Excel uses the active workbook's name.

FileFilter Optional Variant. A string specifying file filtering criteria.

This string consists of pairs of file filter strings followed by the MS-DOS
wildcard file filter specification, with each part and each pair separated by
commas. Each separate pair is listed in the Files of type drop-down list box.
For example, the following string specifies two file filters, text and addin:
"Text Files (*.txt), *.txt, Add-In Files (*.xla), *.xla".

To use multiple MS-DOS wildcard expressions for a single file filter type,
separate the wildcard expressions with semicolons; for example, "Visual Basic
Files (*.bas; *.txt),*.bas;*.txt".

If omitted, this argument defaults to "All Files (*.*),*.*".

FilterIndex Optional Variant. Specifies the index number of the default
file filtering criteria, from 1 to the number of filters specified in
FileFilter. If this argument is omitted or greater than the number of filters
present, the first file filter is used.

Title Optional Variant. Specifies the title of the dialog box. If this
argument is omitted, the default title is used.

ButtonText Optional Variant. Macintosh only.

And you can instantly see that you need to use:

InitialFilename as in:

fname = Application.GetSaveAsFilename( _
InitialFilename:="", _
FileFilter:="Microsoft Excel Workbook (*.xls), *.xls")

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Paige" wrote:

I have the following code that is used to prompt a user to save the current
file:

fname = Application.GetSaveAsFilename(FileFilter:="Microso ft Excel Workbook
(*.xls), *.xls")

However, when the save menu pops up, it has the current name of the file in
the filename slot as a default. I want it to be blank tho, to force the user
to type in name. Does someone know how I can modify the above to do that?

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
Ensuring Correct Vin Number is entered Rocko Excel Discussion (Misc queries) 2 July 2nd 09 07:55 AM
Ensuring 3 cells do NOT match GIdunno Excel Discussion (Misc queries) 12 September 6th 07 09:36 PM
ensuring at least one checkbox is checked from a group [email protected] Excel Programming 1 January 22nd 07 10:20 PM
Ensuring Macros are running ccarmock Excel Programming 2 October 1st 05 08:21 PM
there must be a better way - ensuring userforms are closed JulieD Excel Programming 10 September 7th 04 10:36 AM


All times are GMT +1. The time now is 08:35 AM.

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"