ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   GetSaveAsFilename - file name is blank (https://www.excelbanter.com/excel-programming/412896-getsaveasfilename-file-name-blank.html)

JanetJek

GetSaveAsFilename - file name is blank
 
I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003, 2007)
but with Excel 2007 and Vista, the file name in the prompt box is empty,
blank. There is no file name.

Any suggestions?

Ron de Bruin

GetSaveAsFilename - file name is blank
 
Hi Janet

This is working for me in Vista/O2007

Dim fname As Variant
fname = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm", _
fileFilter:="Excel Files (*.xlsm), *.xlsm")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JanetJek" wrote in message ...
I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003, 2007)
but with Excel 2007 and Vista, the file name in the prompt box is empty,
blank. There is no file name.

Any suggestions?


Rick Rothstein \(MVP - VB\)[_2157_]

GetSaveAsFilename - file name is blank
 
It looks like if you do not provide the FileFilter argument, the InitialFile
argument is ignored. This, of course, is different than with XL2003.

Rick


"JanetJek" wrote in message
...
I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003, 2007)
but with Excel 2007 and Vista, the file name in the prompt box is empty,
blank. There is no file name.

Any suggestions?



Rick Rothstein \(MVP - VB\)[_2158_]

GetSaveAsFilename - file name is blank
 
Remove the fileFilter argument and you will see what the OP is writing
about... apparently XL2007 changed something as XL2003 works fine with just
the InitialFile argument.

Rick


"Ron de Bruin" wrote in message
...
Hi Janet

This is working for me in Vista/O2007

Dim fname As Variant
fname = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm", _
fileFilter:="Excel Files
(*.xlsm), *.xlsm")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JanetJek" wrote in message
...
I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003, 2007)
but with Excel 2007 and Vista, the file name in the prompt box is empty,
blank. There is no file name.

Any suggestions?



Ron de Bruin

GetSaveAsFilename - file name is blank
 
Hi Rick

Ok, i never used it without filefilter

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Rick Rothstein (MVP - VB)" wrote in message ...
Remove the fileFilter argument and you will see what the OP is writing
about... apparently XL2007 changed something as XL2003 works fine with just
the InitialFile argument.

Rick


"Ron de Bruin" wrote in message
...
Hi Janet

This is working for me in Vista/O2007

Dim fname As Variant
fname = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm", _
fileFilter:="Excel Files
(*.xlsm), *.xlsm")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JanetJek" wrote in message
...
I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003, 2007)
but with Excel 2007 and Vista, the file name in the prompt box is empty,
blank. There is no file name.

Any suggestions?



Rick Rothstein \(MVP - VB\)[_2160_]

GetSaveAsFilename - file name is blank
 
And, of course, it makes good sense to **always** use FileFilter (OP please
take note)... I am not sure why Microsoft decided to change
GetSaveAsFilename in XL2007 making the display of InitialFile contingent on
its use though.

Rick


"Ron de Bruin" wrote in message
...
Hi Rick

Ok, i never used it without filefilter

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Rick Rothstein (MVP - VB)" wrote in
message ...
Remove the fileFilter argument and you will see what the OP is writing
about... apparently XL2007 changed something as XL2003 works fine with
just the InitialFile argument.

Rick


"Ron de Bruin" wrote in message
...
Hi Janet

This is working for me in Vista/O2007

Dim fname As Variant
fname = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm", _
fileFilter:="Excel Files
(*.xlsm), *.xlsm")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JanetJek" wrote in message
...
I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003,
2007) but with Excel 2007 and Vista, the file name in the prompt box is
empty, blank. There is no file name.

Any suggestions?




JanetJek

GetSaveAsFilename - file name is blank
 
Thanks Rick and Ron, you saved my day.
And I'll certainly use FileFilter from now on!

"Rick Rothstein (MVP - VB)" wrote:

And, of course, it makes good sense to **always** use FileFilter (OP please
take note)... I am not sure why Microsoft decided to change
GetSaveAsFilename in XL2007 making the display of InitialFile contingent on
its use though.

Rick


"Ron de Bruin" wrote in message
...
Hi Rick

Ok, i never used it without filefilter

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Rick Rothstein (MVP - VB)" wrote in
message ...
Remove the fileFilter argument and you will see what the OP is writing
about... apparently XL2007 changed something as XL2003 works fine with
just the InitialFile argument.

Rick


"Ron de Bruin" wrote in message
...
Hi Janet

This is working for me in Vista/O2007

Dim fname As Variant
fname = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm", _
fileFilter:="Excel Files
(*.xlsm), *.xlsm")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JanetJek" wrote in message
...
I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003,
2007) but with Excel 2007 and Vista, the file name in the prompt box is
empty, blank. There is no file name.

Any suggestions?




Stephen

GetSaveAsFilename - file name is blank
 
Thanks for the heads up Ron,

However; I have that code implemented, but I am receiving an error message
(file format or extension) when I try to re-open the file.

Any thoughts? Thanks ~ Stephen

here is the code on 1 line ...

fName = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm",
FileFilter:="Excel Files (*.xlsm), *.xlsm")

"Ron de Bruin" wrote:

Hi Janet

This is working for me in Vista/O2007

Dim fname As Variant
fname = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm", _
fileFilter:="Excel Files (*.xlsm), *.xlsm")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JanetJek" wrote in message ...
I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003, 2007)
but with Excel 2007 and Vista, the file name in the prompt box is empty,
blank. There is no file name.

Any suggestions?



Charlie Hall

And, of course, it makes good sense to **always** use FileFilter(OP please
 
The situation is more bizarre than presented. I was still getting the problem even with using filefilters argument

I was trying to save an xlt file with the following:

filefilter:="Template (*.xlt; *.xltm; *.xltx), *.xlt; *.xltm; *.xltx"

This works perfectly well on XL 2003. However on 2007 the initial filename would be blank

I discovered after some time that the initial filename extension must match the final file filter before it will be displayed

so this works on 2007:

filefilter:="Template (*.xltx; *.xltm; *.xlt), *.xltx; *.xltm; *.xlt"


On Friday, June 20, 2008 2:31 PM JanetJe wrote:


I have an Excel macro that prompts the user for the file name with
GetSaveAsFilename. It works fine under Window XP (Excel 2000, 2003, 2007)
but with Excel 2007 and Vista, the file name in the prompt box is empty,
blank. There is no file name.

Any suggestions?



On Friday, June 20, 2008 2:38 PM Ron de Bruin wrote:


Hi Janet

This is working for me in Vista/O2007

Dim fname As Variant
fname = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm", _
fileFilter:="Excel Files (*.xlsm), *.xlsm")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JanetJek" wrote in message ...



On Friday, June 20, 2008 2:45 PM Rick Rothstein \(MVP - VB\) wrote:


It looks like if you do not provide the FileFilter argument, the InitialFile
argument is ignored. This, of course, is different than with XL2003.

Rick



On Friday, June 20, 2008 2:53 PM Rick Rothstein \(MVP - VB\) wrote:


Remove the fileFilter argument and you will see what the OP is writing
about... apparently XL2007 changed something as XL2003 works fine with just
the InitialFile argument.

Rick



On Friday, June 20, 2008 3:29 PM Ron de Bruin wrote:


Hi Rick

Ok, i never used it without filefilter

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm



On Friday, June 20, 2008 3:49 PM Rick Rothstein \(MVP - VB\) wrote:


And, of course, it makes good sense to **always** use FileFilter (OP please
take note)... I am not sure why Microsoft decided to change
GetSaveAsFilename in XL2007 making the display of InitialFile contingent on
its use though.

Rick


"Ron de Bruin" wrote in message
...



On Friday, June 20, 2008 5:03 PM JanetJe wrote:


Thanks Rick and Ron, you saved my day.
And I will certainly use FileFilter from now on!

"Rick Rothstein (MVP - VB)" wrote:



On Monday, February 22, 2010 3:46 PM Stephen wrote:


Thanks for the heads up Ron,

However; I have that code implemented, but I am receiving an error message
(file format or extension) when I try to re-open the file.

Any thoughts? Thanks ~ Stephen

here is the code on 1 line ...

fName = Application.GetSaveAsFilename(InitialFileName:="te st.xlsm",
FileFilter:="Excel Files (*.xlsm), *.xlsm")

"Ron de Bruin" wrote:



Submitted via EggHeadCafe - Software Developer Portal of Choice
ASP.NET MaskedTextBox Custom Control
http://www.eggheadcafe.com/tutorials...m-control.aspx



All times are GMT +1. The time now is 04:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com