
Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
I've read the code written by Mr Dev on thesite but that is not excatly what
I
want.Here is my condition:
Some data that I want to output to are on the form Header,and the others
are on the detail section of my continuous form.Below is where I've got so
far
Dim appXL As Object
Dim wkb As Object
Dim wks As Object
Set appXL = CreateObject("Excel.Application")
Set wkb = appXL.Workbooks.Open("C:\MyFolder\My Workbook.xls")
Set wks = wkb.Worksheets(1)
appXL.Visible = True
wks.Cells(4, 3) = [Customer]
wks.Cells(6, 3) = [LotNo]
wks.Cells(7, 3) = [Model]
Field 'Customer' and 'LotNo' are on the form header and 'Model' is on
the detail form.And I always limitting the number of record returned to
5 record only that mean excel cell (7, 3) until cell (11, 3) should contains
the 5 values of the 'Model'.How to do that.?
> Instead of inserting values cell by cell, you can use Excel ranges to insert
> records row by row. Here's some code that will do that:
[quoted text clipped - 34 lines]
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
Arvin Meyer [MVP] - 31 Dec 2007 03:51 GMT
> Field 'Customer' and 'LotNo' are on the form header and 'Model' is on
> the detail form.And I always limitting the number of record returned to
> 5 record only that mean excel cell (7, 3) until cell (11, 3) should
> contains
> the 5 values of the 'Model'.How to do that.?
You must build a recordset or a query and either export the query with the
TransferSpreadsheet function (look it up in help)
Or loop through a recordset, writing the data to the Excel sheet one cell at
a time.

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com