Sending Report data to existing Excel file..

Arcadia

Registered User.
Local time
Today, 10:47
Joined
Jan 25, 2013
Messages
66
Hi, in Access i have made a report with data and now my goal is that if i click on a button the data will be exported to a existing Excel file under the other existing data so in row A6.

Is this possible true a VBA code? :)
 
Using native functions like DoCmd.OutputTo or DoCmd.TransferSpreadsheet it might not be really possible to add data to an existing file. However using the CreateObject you can create an instance of the Excel object open excel and use CopyRecordset function to paste data from Access to desired range in Excel. Search on the internet, so many hits available.

Good luck !
 
another suggestion might be to build the functionality into the Excel workbook itself by setting a connection to the database, define some SQL to query the required data and as pr2 suggests use the CopyRecordset function to dump it on to the worksheet in the next available row.

David
 

Users who are viewing this thread

Back
Top Bottom