Export multiple Queries to same Workbook Cant overwrite Content

Wapug

Registered User.
Local time
Today, 09:30
Joined
Apr 14, 2017
Messages
51
I have an access db where I have written code to export the results of three queries to an excel workbook. The workbook will contain, or may contain data from previous exports and I would like to have the new data from my db overwrite the existing data in the workbook.
I have used the TransferSpreadsheet method to export the three queries. How can I add code that will delete any existing data on the three tabs in the target workbook?
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "qBacon", strpath
 
The export does not erase the previous data.
Can you just erase the workbook, then export?
 
MMmmmmmm......qBacon......
 
The export does not erase the previous data.
Can you just erase the workbook, then export?

I don't want to delete the entire workbook because it contains multiple other sheets with information that is needed.
 

Users who are viewing this thread

Back
Top Bottom