That code is real easy to use. First copy from:
*** Code Start ***
to...
*** Code End ***
...into a standard module named basCode. Then to use it just follow the instruction above the code in the link:
Code:
To call the actual dialog from your code, see the included function TestIt() within the module or use the following example as a guideline and
Dim strFilter As String
Dim strInputFileName as string
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Note that in order to call the Save As dialog box, you can use the same wrapper function by just setting the OpenFile option as False. For example,
'Ask for SaveFileName
strFilter = ahtAddFilterItem(myStrFilter, "Excel Files (*.xls)", "*.xls")
strSaveFileName = ahtCommonFileOpenSave( _
OpenFile:=False, _
Filter:=strFilter, _
Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)