Kill a Specific Worksheet

MonkeyChico

Registered User.
Local time
Today, 10:51
Joined
May 11, 2010
Messages
18
I'm using "DoCmd.TransferSpreadsheet acExport" to export two queries to two existing worksheets in an Excel workbook (the exported queries are used to populate pivot tables on the other worksheets).

The export works, but I've noticed that the export doesn't completely overwrite the exisiting worksheet. If the existing worksheet has 10 rows, but the new export has 5 rows, it will only replace the first 5 rows.

My question - is there a way to code "DoCmd.TransferSpreadsheet acExport" to completely overwrite the worksheet?

If not, can I use the Kill code to kill just that worksheet prior to the export? I know the following code kills the entire workbook, but I want to specify the worksheet: Kill "C:\Book1.xls"

Thanks!
 

Users who are viewing this thread

Back
Top Bottom