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

How do you export a table to Excel with a range?

Status
Not open for further replies.

roaml

Technical User
Feb 19, 2002
264
US
Hi,

I am trying to follow Microsoft Access Help on exporting data for a particular range, but I am having no luck with a successful output. I am using MSAccess 2000.

Here is part of my code:

<CODE>
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "daily_wo_qry", "C:\WO_Report.xls",True, "WO_Issues"
<CODE>

I tried to replace the "WO_Issues" with a range "A2:BB100", but that did not work.

The error I receive is...

<ERROR>
"The table 'A2:BB100' already exists."
<ERROR>
Any suggestions?
 
Have you considered opening the Excel file and choosing Data > New Database Query?
 
Okay, I will try that option.

Thank you.
 
Here are a couple of threads, one of which makes a similar suggestion to Lilliabeth's:
Fastest way to splat data into excel?
thread707-1075448
Export Access table to specific cell range in Excel
thread705-905632
 
I think I inadvertently gave the command slightly wrong - it's Data > Import External Data > New Database Query.

I love it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top