473,472 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

.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 12386
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rob | last post by:
Help me, I'm just beginning with programming in Access 2000. I've tried the http://www.mvps.org/access/api/api0001.htm but it won't work in Access. What am i doing wrong. I don't have...
2
by: Steve Teeples | last post by:
I am using the Filter property within OpenFileDialog. I understand how to filter files with extensions, but this time I need to filter files without extensions. Can someone tell me how this is...
4
by: Steve Teeples | last post by:
I understand how the filter and filterindex works in the OpenFileDialog class. However, I want to filter files that don't have extensions, but the filter doesn't seem to understand this type of...
9
by: John | last post by:
Hi I am using the following for the filter but it allows me to display only one of either an htm or an html file. dlgOpenFile.Filter = "Html files (*.html)|*.html|Htm files (*.htm)|*.htm" ...
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the dialog first opens, the filter works correctly, and...
5
by: JimmyKoolPantz | last post by:
Situation: I am writing a program that opens up a data file (file ext .dbf), imports the information into a dataset. The program also, searches through the dataset for key words ("company...
6
by: awel | last post by:
Hello All, I am trying to to make a script to move all the files that has been created at today's to another folder but my problem is the date format that I receive from the 'os.stat ' is...
1
by: ganesandeiav | last post by:
Dear frnds I am using jsp.I have a problem file upload using html control.I want filter seleted file such as *.gif&*.jpeg images .It should be list out jpeg gif image only. iam try this code but...
8
by: Z.K. | last post by:
I would like to display two different types of files when bringing up the OpenFileDialog, but I can't seem to figure out how to do this. I can manage a single file type or all file types, but not...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.