Creating excel files using VBA

  • Thread starter Thread starter sameerce
  • Start date Start date
S

sameerce

Hi,
I am working on a VB application which will export the results to a
Excel file. The Excel file generated should also have graphs in it.
To do this I am planning to have a excel file already existing on th
hard drive path which will be having the graphs with reference t
certain rows and columns. The application should make a copy of th
file, rename it and put the file at the same path as the original one
Later on the application should change the results obtained dynamicall
in the workbook, so that the graphs are changed accordingly.

Can anyone tell me how can I make copy of a existing excel file, renam
and save it.

Thanks in advance,

Samee
 
Hi,
application.savecopyas "machinename\shareddrive\path\filename.xls"

But what you really need is called a template.
file>save as> select "template" as the file type in the drop down box.

Turn on the macro recorder and do...
file>new select the template file.
And you have the code.
 

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

Back
Top