Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetSaveAsFileName on Mac (OS/X)

795 views
Skip to first unread message

Annie Hamilton

unread,
Jan 15, 2003, 3:25:20 PM1/15/03
to
I have a VBA macro which exports data to a file with a custom format.
Before exporting I prompt the user for a filename, which normally has a CSV
extension (the custom format is based on CSV). I do this thus:

sFileName = "SomeFileName.CSV"
vntFileName = Application.GetSaveAsFilename(sFileName, sFilter, 1)
...

where sFileName contains a default filename and sFilter contains a filter
string: for Windows this is:

sFilter = "CSV files (*.CSV), *.CSV,All files (*.*),*.*"

I need to port this to Excel for Macintosh (on OS/X).

Currently I set sFilter = "" on the Macintosh. When the Save As dialog is
displayed, I have the following problems:

- the default filename displayed is "SomeFileName.xls" (i.e. an XLS
extension rather than the CSV extension I supplied in sFilename)
- the default file type is "Excel spreadsheet".

The user can change the default file type to "CSV file" in the dialog, and
the extension then changes to CSV. But I want CSV to appear as the default
extension.

Does anyone know how to do this? E.g. by supplying a suitable file type
value in sFilter.

I have tried sFilter = "TEXT" (and I still get Excel spreadsheet as the
default type), and sFilter = "CSV" (causes a runtime error in SaveAsFilename
method).

Annie


Bob Greenblatt

unread,
Jan 16, 2003, 8:17:13 AM1/16/03
to
in article uTuiyQNvCHA.1676@TK2MSFTNGP10, Annie Hamilton at

Interesting! The knowledgebase articles seem to imply that this is known
issue and it is by design. However, you should report your concerns to
Microsoft via the send feedback option on the help menu.

--
Bob Greenblatt [Excel MVP]
Bobgre...@msn.com
www.bandlassoc.com

Annie Hamilton

unread,
Jan 16, 2003, 8:53:25 AM1/16/03
to
Thanks for the response. Can you let me have the numbers of the KB articles
you're referring to?

"Bob Greenblatt" <bobgre...@msn.com> wrote in message
news:BA4C1B09.1CD4C%bobgre...@msn.com...

Bob Greenblatt

unread,
Jan 17, 2003, 8:20:25 AM1/17/03
to
in article eAdDdaWvCHA.2668@TK2MSFTNGP09, Annie Hamilton at

Try 183750

Annie Hamilton

unread,
Jan 17, 2003, 12:49:54 PM1/17/03
to

> >
> Try 183750
>

Got it, many thanks.


0 new messages