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

TransferSpreadSheet ..export

Status
Not open for further replies.

jonnj

Programmer
Jun 20, 2003
29
US
I want to export a ms query to an excel sheet template to a specific cell range.
I would like the export results to begin at cell "a6".
I have googled myself to exhaustion, trying many suggestions. The common opinion is that the following code should work, (but it does not for me).

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qtestexport", "c:\United\teamtemp.xlsx", True, "teamtemp!A6:a90"
End Sub
[I am using office 2007]

Teamtemp.xlsx is the template and teamtemp is the worksheet name. I have tried leaving it at sheet1 with no results.


The error here tells me that the range already exits. This is one of the many errors I have received.

I have run the code where it creates another sheet, but not in the template.

Any help, suggestions or solutions is greatly appreciated.

Thanks in advance
John
 
How are ya jonnj . . .
Microsoft TransferSpreadsheet said:
[blue]Range: Optional Variant. A string expression that's a valid range of cells or the name of a range in the spreadsheet. [purple]This argument applies only to importing[/purple]. Leave this argument blank to import the entire spreadsheet. [purple]When you export to a spreadsheet, you must leave this argument blank[/purple]. [red]If you enter a range, the export will fail[/red].[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
TheAceman1,

I am aware of what the MS 'help' says. Many times here, I know programmers find ways around microsofts' protocol, and was hoping someone here might have a work around for this.

Thx for responding tho.
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top