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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export Data from Table into Excel Spreadsheet.

Status
Not open for further replies.

JLeo

Technical User
Feb 10, 2003
44
US
Hi,

I need to automate the transfer of data stored in a table 'tblChartData' into an Excel spreadsheet 'table' for chart plotting purposes.

I've tried using
DoCmd.TransferSpreadsheet acExport, , "tblChartData", "L:\TCH Traffic Chart.xls", False

and

DoCmd.TransferDatabase acExport, , "C:\WINNT\Profiles\tempnwmobile01\Desktop\mar30.mdb", , "traffic(E)", "L:\TCH Traffic Chart.xls", False

but to no avail. It gives an error msg of "Object tblChartData not found" and "Doesnt support the operation" respectively.

Where is the error in my coding? Am i using the right approach? Any advice is most appreciated.
 
Try this:


DoCmd.TransferSpreadsheet acExport, 8, "tblChartData", "L:\TCH Traffic Chart.xls", False, ""


I have tested this on my system and it should work. David Lerwill
"If at first you don't succeed go to the pub"
 
Hi dwlerwill,

Thanks for the reply. Tried that but still i get the same error msg and result.

runtime error 3011: "Object tblChartData not found".
All i get in the Excel workbook is a blank worksheet but with the headers on. Strange... No data only headers.

I'm sure that i've not mis-spelt anything.Also is there a need to add any references???
 
You should not need to add any references, as I said I tried it on mine and it worked. If there is no confidential data in it can you send me a copy and I will take a look and send it back.

david.lerwill@ntlworld.com David Lerwill
"If at first you don't succeed go to the pub"
 
Thanks for the offer.

Please check your mail.

Hope to get the reply soon. Will get back once i'm back in office.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top