Private Sub CommandBtn_Click()
Dim RetVal As Long
Dim FileName As String
Dim Path As String
RetVal = FileDialog(hwnd, FileName, "Executable Files(*.EXE)" + String(1, 0) + "*.EXE" + String(1, 0), "", "EXE"

If RetVal > 0 Then txtCtrl = Left(FileName, InStr(FileName, Chr(0)) - 1)
Exit Sub
End Sub
Have a module with following Fns
Option Compare Database
Option Explicit
Private Const BIF_RETURNONLYFSDIRS = 1
Private Const MAX_PATH = 260
Public Const OFN_EXPLORER = &H80000
Public Const OFN_HIDEREADONLY = &H4
Public Const OFN_NOLONGNAMES = &H40000
Public Const OFN_NOREADONLYRETURN = &H8000
Public Const OFN_PATHMUSTEXIST = &H800
Public Const OFN_FILEMUSTEXIST = &H1000
Public Const OFN_OVERWRITEPROMPT = &H2
Public Const OFN_LONGNAMES = &H200000
'Open File structure
Type OPENFILENAME
lStructSize As Long
hWndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Declare Function GetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" _
(lpbi As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" _
(ByVal pidList As Long, _
ByVal lpBuffer As String) As Long
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" _
(ByVal lpString1 As String, ByVal _
lpString2 As String) As Long
Private Type BrowseInfo
hWndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
Public Function FileDialog(hwnd As Long, pFileName As String, pFilter As String, pDir As String, pDefExt As String) As Long
Dim op As OPENFILENAME
op.lStructSize = Len(op)
op.hWndOwner = hwnd
op.lpstrFilter = pFilter
op.lpstrFile = String(255, 0)
op.nMaxFile = 255
op.lpstrInitialDir = pDir
op.flags = OFN_EXPLORER Or OFN_HIDEREADONLY Or OFN_LONGNAMES Or OFN_PATHMUSTEXIST Or OFN_FILEMUSTEXIST
op.lpstrDefExt = pDefExt
' MsgBox op.nFileExtension
' MsgBox op.nFilterIndex
FileDialog = GetOpenFileName(op)
' MsgBox op.nFileExtension
' MsgBox op.nFilterIndex
pFileName = op.lpstrFile
End Function
'======= Code Ends Here
This should surely work out for you