Thread: graceful exits
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bryan[_12_] Bryan[_12_] is offline
external usenet poster
 
Posts: 7
Default graceful exits

This code is used to find and open text files to import into a worksheet.

' Get the file name
Dim FName As Variant
FName = Application.GetOpenFilename("Excel file (*.txt),*.txt)")
If FName = False Then
MsgBox "No file selected"
Else
MsgBox "You chose: " & FName
End If

In the False section I want to add in a line to simply exit the macro. The
functionality I need is:
MsgBox "No file selected"
Exit_Macro
What is the code to exit the macro here?