Thanks! That is what I was looking for.
Fully tested and functional.
Attach code to onclick of command button.
Dim strFilter As String
Dim strSaveFileName As String
'Display dialog
strFilter = ahtAddFilterItem(strFilter, _
"Excel Files (*.XLS)", "*.XLS")
strSaveFileName = ahtCommonFileOpenSave( _
OpenFile:=False, _
Filter:=strFilter, _
Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
If Len(strSaveFileName) > 0 Then 'User entered a filename
DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel8, "EnterQueryNameHere", _
strSaveFileName
Else 'User pressed Cancel
'Do nothing
End If

Signature
I may not know VBA inside out, but from the outside I am looking in.
Dylan Moran - Melbourne Australia
> Thanks! That is what I was looking for.
>
[quoted text clipped - 5 lines]
> >
> > John W. Vinson[MVP]
Hyperactive - 22 Jun 2005 19:10 GMT
Can you give me an idea of how I could do this using VB.NET in a windows app,
pulling from a database query? Thanks for your help!
> Fully tested and functional.
> Attach code to onclick of command button.
[quoted text clipped - 28 lines]
> > >
> > > John W. Vinson[MVP]
Dylan Moran - 23 Jun 2005 00:58 GMT
No, sorry. No idea.
> Can you give me an idea of how I could do this using VB.NET in a windows app,
> pulling from a database query? Thanks for your help!
[quoted text clipped - 31 lines]
> > > >
> > > > John W. Vinson[MVP]
Justin - 09 Dec 2005 14:49 GMT
If you use this code, you must download a module which Dylan's code is
referencing to. Maybe he forgot to mention?
go to http://www.mvps.org/access/api/api0001.htm
and copy the code from
'******Code Start******
to
'++++++Code End******
and paste it in a new module. Save it as anything and then insert Dylan's
code to your control. It will now work.
> Fully tested and functional.
> Attach code to onclick of command button.
[quoted text clipped - 28 lines]
> > >
> > > John W. Vinson[MVP]