select file dialog box for dummies pls

I

Iona

Hi, ok i've been checking out the howto 'open file dialog box' posts,
and have checked out the api, howeve i'm stymed on how to actually use
the code, yes you paste it into a new module, but then what, how do you
call this from form button. Sorry if this is a bit basic, but I've only
been doing this for two weeks now, its all rather new, any pointers
would be appreciated.

kind regards
iona
 
K

Klatuu

There is a function in the module named Testit. You can use that to see how
it works. Also, here is an example of how I have used it:

'Set up default path and file
strDefaultDir = "\\rsltx1-bm01\busmgmt\Vought " & strCurrYear & "\" &
strCurrYear _
& " Actuals\" & strCurrMonth & "\FFP Charts\"
strDefaultFileName = Me.cboOffering & " Summary " &
Me.cboPeriod.Column(1) _
& " " & Me.txtCurrYear & ".xls"
'Set filter to show only Excel spreadsheets
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)")
'Flags Hides the Read Only Check and Only allow existing files
lngFlags = ahtOFN_HIDEREADONLY Or ahtOFN_OVERWRITEPROMPT
'Call the Open File Dialog
varGetFileName = ahtCommonFileOpenSave( _
OpenFile:=False, _
InitialDir:=strDefaultDir, _
Filter:=strFilter, _
Filename:=strDefaultFileName, _
Flags:=lngFlags, _
DialogTitle:="Save Report")
If varGetFileName <> "" Then
xlBook.SaveAs Filename:=varGetFileName
End If
 
I

Iona

Hi and thankyou, now i know this sounds really basic, but how do i
call(?) this from a command button on a form.. Do i cut and paste the
below into a private sub button_click
code? Sorry about this, I've only started doing this stuff two weeks
ago, so I still get a bit mystified.

cheers
Honor
 
Top