Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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?



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default 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?


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

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
GetSaveAsFilename alwyas overwrites existing file jeff Excel Programming 4 March 12th 07 03:03 AM
GetSaveAsFilename Dave Peterson Excel Programming 0 December 21st 06 04:33 PM
Help with GetSaveAsFilename aj Excel Programming 0 March 23rd 06 08:32 PM
GetSaveAsFileName Greg Hadrych Excel Programming 1 July 29th 04 12:52 AM
File save location with Application.GetSaveAsFilename Brad Patterson Excel Programming 1 July 21st 03 04:01 AM


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