export data to existing Excel file

export data to existing Excel file

Post by Rast » Thu, 24 Mar 2005 06:22:35


Is there a way to export data from access to an existing excel file - just
overwriting what's in the excel file rather than replacing the entire file?

thanks
 
 
 

export data to existing Excel file

Post by John Nuric » Fri, 25 Mar 2005 06:17:52

In general the answer is yes. But the fact you want to do it means you
must want to preserve something in the Excel workbook. What? It's
relevant to how best to do the job.




Please respond in the newgroup and not by email.

 
 
 

export data to existing Excel file

Post by U2hhcmsgSn » Fri, 27 May 2005 07:00:04

If he won't answer I will. I would like to export the query results to a
"Data" tab in a preexisting Excel File because I have charts and calcs tied
to it. How is this possible?
 
 
 

export data to existing Excel file

Post by John Nuric » Fri, 27 May 2005 14:55:31

Make sure there's nothing else on the Data sheet. Then, something like
this should do it, replacing the table on the Data sheet with the
exported one.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, _
"MyQuery", "D:\Folder\File.xls", True, "Data"


On Wed, 25 May 2005 15:00:04 -0700, Shark Jr. <Shark





Please respond in the newgroup and not by email.