[AccessD] Writing to an excel file

Gustav Brock Gustav at cactus.dk
Tue Aug 2 09:25:35 CDT 2005


Hi Lonnie

If you fill in the same amount of rows it should be quite easy:

1. In the worksheet, create a Named Range covering the rows and columns
you write to.
2. Attach (link) that Named Range as a table in Access as, say,
xlsMonthData.
3. In Access, use an update query to update the table xlsMonthData.

If you write in fewer records (rows) than already filled, it is
slightly more complicated as you cannot delete the excessive rows;
you'll have to erase the table field by field by a double loop in VBA
which nulls out field by field, row by row before you run the update
query. 

Of course, if you prefer, you can use VBA also to update the table
avoiding the update query.

/gustav

>>> prodevmg at yahoo.com 08/02 2:35 pm >>>
I have a recordset that I would like to write as rows in an excel
spreadsheet. 
 
I want to start on a certain line. 
 
The columns are already predefined and match my recordset. 
 
This will run each month so it will need to overwrite the prior month's
data.
 
What is the best way to go about this?




More information about the AccessD mailing list