Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default GetOpenFilename and filter "*."

I have encountered an odd quirk in GetOpenFilename in Excel 2003

It works fine provided that you never have to use the filter for files
with no file extension. If you attempt to filter on "*." the entry is
completely ignored!
(No error message or syntax error parsing it just vanishes from the
listbox)

Filename = Application.GetOpenFilename("All files
(*.*),*.*,Bug(*.),*.,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with just two entries "All files, Other". The parser
appears to have ignored the Bug entry completely.

Filename = Application.GetOpenFilename("All files
(*.*),*.*,Bug(*.?),*.?,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with 3 entries as expected, but alas "*.?" does not
match our hard to find "*." filenames.

Filename = Application.GetOpenFilename("All files (*.*),*.*,Bug(*.
),*. ,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with 3 entries as expected. Unfortunately ". " does
not match a file with no extension either.

Anyone see a way to make GetOpenFilename filter for ("*.") ?

I tried the knowledgebase but it didn't seem to have anything on this.

Thanks for any enlightenment or workarounds. "*.*" sees the relevant
files, but is not especially convenient as it sees everything else as
well.

Regards,
--
Martin Brown

--
Posted via a free Usenet account from http://www.teranews.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default GetOpenFilename and filter "*."

Hi,
It seems to me that it is not possible to make a filter like that. However,
if you enter "*." in the Filename box (after the Open dialog box is opened),
and press enter, then the files will be filtered according to that entry.
Admitted, this is not a perfect workaround to the Question, but useful
anyway.
regards,
Lazzzx


"Martin Brown" skrev i meddelelsen
...
I have encountered an odd quirk in GetOpenFilename in Excel 2003

It works fine provided that you never have to use the filter for files
with no file extension. If you attempt to filter on "*." the entry is
completely ignored!
(No error message or syntax error parsing it just vanishes from the
listbox)

Filename = Application.GetOpenFilename("All files
(*.*),*.*,Bug(*.),*.,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with just two entries "All files, Other". The parser
appears to have ignored the Bug entry completely.

Filename = Application.GetOpenFilename("All files
(*.*),*.*,Bug(*.?),*.?,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with 3 entries as expected, but alas "*.?" does not
match our hard to find "*." filenames.

Filename = Application.GetOpenFilename("All files (*.*),*.*,Bug(*. ),*.
,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with 3 entries as expected. Unfortunately ". " does
not match a file with no extension either.

Anyone see a way to make GetOpenFilename filter for ("*.") ?

I tried the knowledgebase but it didn't seem to have anything on this.

Thanks for any enlightenment or workarounds. "*.*" sees the relevant
files, but is not especially convenient as it sees everything else as
well.

Regards,
--
Martin Brown

--
Posted via a free Usenet account from http://www.teranews.com


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default GetOpenFilename and filter "*."

In message , Lazzzx
writes
Hi,
It seems to me that it is not possible to make a filter like that.


I know :(
The syntax is valid, files with a null extension are valid even in DOS
8.3 naming.

However, if you enter "*." in the Filename box (after the Open dialog
box is opened), and press enter, then the files will be filtered
according to that entry. Admitted, this is not a perfect workaround to
the Question, but useful anyway.


Doesn't really help. The source data happens to have no file extension.
The purpose of the macro with a filter was to protect jobsworths from
seeing everything else in their working directory. Telling them to type
*. into the filename box is really no different to what happens at
present.

I found an even nastier gotcha after this. If you have two files in the
same directory with the same main name a null and an XLS file extension
and try to open the null extension one programmatically with the
following code:

Workbooks.OpenText Filename:=NEWBUG., Origin:=xlMSDOS, _ StartRow:=1,
DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False,
Comma:=True, Space:=False, Other:=False

and the files are

ASCII CSV file: NEWBUG.
XL file: NEWBUG.xls

Guess which one gets opened! The XLS file of course!!!!
(And there is a trailing dot on the ASCII filename)

Regards,
Martin Brown

regards,
Lazzzx


"Martin Brown" skrev i meddelelsen
...
I have encountered an odd quirk in GetOpenFilename in Excel 2003

It works fine provided that you never have to use the filter for
files with no file extension. If you attempt to filter on "*." the
entry is completely ignored!
(No error message or syntax error parsing it just vanishes from the
listbox)

Filename = Application.GetOpenFilename("All files
(*.*),*.*,Bug(*.),*.,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with just two entries "All files, Other". The
parser appears to have ignored the Bug entry completely.

Filename = Application.GetOpenFilename("All files
(*.*),*.*,Bug(*.?),*.?,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with 3 entries as expected, but alas "*.?" does
not match our hard to find "*." filenames.

Filename = Application.GetOpenFilename("All files (*.*),*.*,Bug(*.
),*. ,Other (*.csv),*.csv", manuf, "Open CSV file")

Displays a listbox with 3 entries as expected. Unfortunately ". "
does not match a file with no extension either.

Anyone see a way to make GetOpenFilename filter for ("*.") ?

I tried the knowledgebase but it didn't seem to have anything on this.

Thanks for any enlightenment or workarounds. "*.*" sees the relevant
files, but is not especially convenient as it sees everything else as
well.

Regards,
-- Martin Brown

-- Posted via a free Usenet account from http://www.teranews.com



--
Martin Brown

--
Posted via a free Usenet account from http://www.teranews.com

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
Pivot Table Report Filter - "OR" instead of "AND" Multiple Filters tommcbrny Excel Discussion (Misc queries) 1 October 29th 09 03:08 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
how can I use "filter" but keep "title" row in sight? Erni Excel Discussion (Misc queries) 4 May 29th 06 05:11 PM
Directory "Locked" when selecting multiple files using GetOpenFilename esbey Excel Programming 1 March 4th 04 04:29 AM


All times are GMT +1. The time now is 01:28 PM.

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"