LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default Small problem with GetopenFileName

Good morning all!

I want to be able to let the user select multiple files from a
GetOpenFileName dialog box, but also filter the file list to Excel files only
and trap for the user pressing Escapel.

If I use:

SAPDataWorkbook = Application.GetOpenFilename()
If SAPDataWorkbook = False Then
Exit Sub
End If
Workbooks.Open Filename:=SAPDataWorkbook

I can press escape OK AND open a workbook

If however I change the first line thus:

SAPDataWorkbook = Application.GetOpenFilename( _
filefilter:="Excel Files (*.xls),*.xls", MultiSelect:=True)
If SAPDataWorkbook = False Then
Exit Sub
End If
Workbooks.Open Filename:=SAPDataWorkbook

to filter to *.xls I can press escape, but get the message "Type mismatch"
with

If SAPDataWorkbook = False Then

highlighted.

Can anyone out there help, please?

Thanks in advance

Pete

 
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
small problem PH NEWS Excel Worksheet Functions 7 March 22nd 06 07:15 PM
Problem with application.getopenfilename Andy TB Excel Programming 2 March 3rd 06 01:29 PM
A small problem for you but big for me! Michael Excel Discussion (Misc queries) 4 June 28th 05 06:38 AM
Problem with small()....I think Weekend user Excel Worksheet Functions 5 May 16th 05 11:21 AM
GetOpenFilename - Problem Tom Excel Programming 2 August 4th 03 07:52 PM


All times are GMT +1. The time now is 10:14 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"