Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting table to spreadsheet in VBA

Status
Not open for further replies.

DoniFromMars

Programmer
Aug 10, 2006
23
0
0
US
Looking for a way to export an access table to a spreadsheet
using VBA. I can export it from the Menu le,export,..datbase type..)
but the vba doesn't recognize the database type "microsoft excel"
How do you tell vba that you want a spreadsheet
thanks for any help
 
Have a look at the DoCmd.TransferSpreadsheet method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
DoCmd.TransferDatabase acExport, "?????", _
"P:\anytownUSA\max.mdb", _
acTable, "Tablename", "P:\anytownUSA\fred.xls"

Thanks . It doesn't accept any value I put in place of the
?????. thats where I'm supposed to specify MSexcel.

the message i get is :
022507: The ????? type isn't an installed database type or doesn't support the operation you chose.
 
I think PHV mentioned TransferSpreadSheet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top