Export data to Excel file...

G

Guest

What I am trying to do is export data or output data to existing excel file.
My excel file 'Results' has a title and the four field names (Field1,
Field2, Field3 and Field4) in worksheets "Result".
My query 'qryRest' has 4 columns, so currently I have 10 records. I am
trying to send data to existing excel file and worksheets, which is 'Result'
and placed the date right under each field names.
For example;
If in my excel file those four fields started from range B10 then data
should start from B11 all the way to B21 for each column.

I used docmd.OutputTo
Yes, it did output data to existing file but created a new worksheet, sense
I already had 'Result' name in my excel file, it created 'Result1' name.
How to send data to existing excel file and worksheets and send to certain
range???

Please help me out.
Thanks.
 
G

Guest

I also did try this way;

Docmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "tblResults",
"c:\Results.xls", true, "Result"

But i still couldn't input data to in existind worksheet.
 
K

Ken Snell \(MVP\)

Only way I know to do what you seek is to Automate EXCEL from within ACCESS
via VBA programming; that will let you know find the last data row in the
worksheet and to begin writing the new data into the next rows.

The built-in methods in ACCESS (export via File menu, or
TransferSpreadsheet) will always overwrite or create a new worksheet,
depending upon how you do the export.
 
G

Guest

I'm having the same issue, but not sure where to start, could you point me to
the right direction, may be a code snippet or an example?

Thank you in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top