How do I copy a file in VBA?

  • Thread starter Thread starter M Skabialka
  • Start date Start date
M

M Skabialka

I am exporting data from Access to Excel, and want to use a template called
Dallas-xxx.xls for the data.
I would like to copy that template to Dallas-123.xls then fill that
spreadsheet to preserve my template.

How do I do the copy-paste in Access 2007 VBA?
 
M Skabialka said:
I am exporting data from Access to Excel, and want to use a template called
Dallas-xxx.xls for the data.
I would like to copy that template to Dallas-123.xls then fill that
spreadsheet to preserve my template.

How do I do the copy-paste in Access 2007 VBA?

To copy a file use FileCopy in your code:

FileCopy sourcefile, destinationfile

Here's a sample of copying a recordset to a specific Excel file:

http://www.mvps.org/access/modules/mdl0035.htm
 
Back
Top