Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default browsing filter

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default browsing filter

On Feb 13, 10:45 am, "mcolson" wrote:
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default browsing filter

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


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


--
Regards,
Tom Ogilvy


"mcolson" wrote in message
oups.com...
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.



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
need a calculation for browsing centre [email protected] Excel Worksheet Functions 2 December 30th 07 06:25 PM
Browsing for a folder in "Look in:" Ruben Gonzales New Users to Excel 1 September 20th 05 07:06 PM
Browsing for a folder in "Look in:" Ruben Gonzales Setting up and Configuration of Excel 1 September 20th 05 06:41 PM
Browsing for a folder in "Look in:" Ruben Gonzales Excel Discussion (Misc queries) 1 September 20th 05 06:09 PM
Browsing for a folder name? Don Wiss Excel Programming 7 May 2nd 04 03:42 AM


All times are GMT +1. The time now is 06:56 AM.

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"