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

FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls), *.xls")
If FName < False Then
Set WB = Workbooks.Open(FName)
Else
Exit Sub
End If

I thought if I hit the Cancel key it would take me to Exit Sub in this case
but that is not the case. How do I catch the Cancel key.

Thank you,

Jimmy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default GetOpenFilename

Try

If TypeName(FName) = "Boolean" Then Exit Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Steven" wrote in message
...
FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls),
*.xls")
If FName < False Then
Set WB = Workbooks.Open(FName)
Else
Exit Sub
End If

I thought if I hit the Cancel key it would take me to Exit Sub in this
case
but that is not the case. How do I catch the Cancel key.

Thank you,

Jimmy




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
Using GetOpenFilename Chaplain Doug Excel Programming 3 February 6th 07 09:01 PM
GetOpenFilename Roman Excel Programming 5 February 8th 05 10:20 PM
GetOpenFilename wtpcomplab Excel Programming 4 January 4th 05 06:36 PM
GetOpenFilename Wolfgang Excel Programming 1 February 6th 04 07:37 PM
getopenfilename inquirer Excel Programming 1 December 3rd 03 11:37 AM


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