LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Export to Range from Access with TransferSpreadsheet

I need to export a series of different Access tables into a single Excel
worksheet with
DoCmd.TransferSpreadsheet.

The problem is positioning each table of data properly in the worksheet:
there needs to be 40 rows between each table.

I'm creating each table on the fly, then dumping it out to Excel like this:

i = 10
For i = 1 To bytNumOfTables
db.Execute ("DROP TABLE tblExcelData"), dbFailOnError
db.Execute ("qryMakeNewTable"), dbFailOnError
db.Execute ("qryPopulateExcelData"), dbFailOnError
DoCmd.TransferSpreadsheet _
TransferType:=acExport, _
SpreadSheetType:=acSpreadsheetTypeExcel5, _
TableName:="tblExcelData", _
FileName:="C:\PathToWorkbook", _
HasFieldNames:=True, _
Range:="P" & i
i = i + 40
Next

So I'm expecting a contiguous block of rows and columns (about 15 rows and
20 columns) starting at P10, then another at P50, another at P90, and so on.
To the left of each contiguous block will be a graph of the data.

Am I specifying the Range parameter correctly?

Why isn't

Range:="P" & i

working?

Is there a better way to do this?

Thanks in advance.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TransferSpreadsheet to colored fields alex Excel Worksheet Functions 0 February 10th 10 03:34 PM
Access 2003: transferspreadsheet writes over existing spreadsheet ragtopcaddy via OfficeKB.com Excel Discussion (Misc queries) 0 April 21st 08 02:01 PM
How do I Export range of row/column data to Access WDR Excel Discussion (Misc queries) 0 January 11th 06 02:57 PM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM
how to rename sht after TransferSpreadsheet method? Rich[_20_] Excel Programming 2 December 8th 03 06:57 PM


All times are GMT +1. The time now is 12:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"