browsing filter

M

mcolson

I have a file that imports data from .xml's and .csv files. If button
1 is pressed, I only want to look for .csv and .xls files, if button 2
is pushed, in only want to look for .xml files. I am using the
following code when 1 is pressed
.Filters.Add "spreadsheet", "*.xls; *.csv", 1
When 2 is pressed I use this filter
..Filters.Add "spreadsheet", "*.xml", 1

They both run fine, until I trying running one after I just ran the
other. When I try to run the other, it uses the filter criteria I
used previously instead the of the criteria I want to use now. I have
to exit the program to get it to work. Does anyone know why this is?
Each filter is performed in separate subroutines and modules. I call
which routine to run when the button is pressed. I have verified that
the buttons are calling the correct functions.
 
M

mcolson

I have a file that imports data from .xml's and .csv files. If button
1 is pressed, I only want to look for .csv and .xls files, if button 2
is pushed, in only want to look for .xml files. I am using the
following code when 1 is pressed
.Filters.Add "spreadsheet", "*.xls; *.csv", 1
When 2 is pressed I use this filter
.Filters.Add "spreadsheet", "*.xml", 1

They both run fine, until I trying running one after I just ran the
other. When I try to run the other, it uses the filter criteria I
used previously instead the of the criteria I want to use now. I have
to exit the program to get it to work. Does anyone know why this is?
Each filter is performed in separate subroutines and modules. I call
which routine to run when the button is pressed. I have verified that
the buttons are calling the correct functions.

It looks like I needed to add a .filters.clear to clear out the
filters first.
 
T

Tom Ogilvy

.Filters.Clear
.Filters.Add "spreadsheet", "*.xls; *.csv", 1


.Filters.Clear
.Filters.Add "spreadsheet", "*.xml", 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top