How do I copy a file in VBA?

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?
 
A

Arvin Meyer [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top