469,291 Members | 1,814 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,291 developers. It's quick & easy.

.Filter for CSV and XLS files

I want to list *.CSV and *.XLS files in a drop down menu using

dlgFileToImport.Filter = "CSV Files (*.csv)| *.csv"
dlgFileToImport.Filter = "Excel Files (*.xls)| *.xls"
dlgFileToImport.DefaultExt = ".csv"

Please what is the syntax for ORing these two requirements.

Many thanks - SB
Jul 17 '05 #1
3 11716
> I want to list *.CSV and *.XLS files in a drop down menu using

dlgFileToImport.Filter = "CSV Files (*.csv)| *.csv"
dlgFileToImport.Filter = "Excel Files (*.xls)| *.xls"
dlgFileToImport.DefaultExt = ".csv"

Please what is the syntax for ORing these two requirements.


Can I assume we are talking about a Microsoft CommonDialog control? If so,
I'd do it the same way the help files show...

With dlgFileToImport
.Filter = "CSV Files (*.csv)|*.csv|Excel Files (*.xls)|*.xls"
.FilterIndex = 1
.ShowOpen
End With

Rick - MVP
Jul 17 '05 #2
Thank you Rick. Just what I neded. I don't have access to the Help
files. My version of VB6 at work was not installed with them, and when
I click on Help all I get are references to MSDN again which was also
not installed. SB.

"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message news:<xN********************@comcast.com>...
I want to list *.CSV and *.XLS files in a drop down menu using

dlgFileToImport.Filter = "CSV Files (*.csv)| *.csv"
dlgFileToImport.Filter = "Excel Files (*.xls)| *.xls"
dlgFileToImport.DefaultExt = ".csv"

Please what is the syntax for ORing these two requirements.


Can I assume we are talking about a Microsoft CommonDialog control? If so,
I'd do it the same way the help files show...

With dlgFileToImport
.Filter = "CSV Files (*.csv)|*.csv|Excel Files (*.xls)|*.xls"
.FilterIndex = 1
.ShowOpen
End With

Rick - MVP

Jul 17 '05 #3
> Thank you Rick. Just what I neded. I don't have access to the Help
files. My version of VB6 at work was not installed with them, and when
I click on Help all I get are references to MSDN again which was also
not installed. SB.


You should ask whoever is in charge of such thing to install it... it is
ludicrous to not have it available.

Although more awkward to use, you can view the entire MSDN (which contains
the VB help files) online at this link...

http://msdn.microsoft.com/library/default.asp

Specifically, open the "tree" to this...

Visual Tools and Languages
Visual Studio 6.0
Visual Basic 6.0
Product Documentation
Reference
Language Reference

Look around under Reference for other things you might find interesting.

Rick - MVP
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Steve Teeples | last post: by
4 posts views Thread by Steve Teeples | last post: by
9 posts views Thread by John | last post: by
5 posts views Thread by JimmyKoolPantz | last post: by
6 posts views Thread by awel | last post: by
8 posts views Thread by Z.K. | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.