Changing filenames using theSaveAsCopy method

G

Guest

Here's the problem: I would like to open a file, for instance C:\Documents and Settings\Me\Folder1\file.xls, perform some basic operations, and save it as C:\Documents and Settings\Me\Folder2\file.xls. How can I alter the filename in such a way?
 
F

Frank Kabel

Hi
in your macro use the .saveas method. e.g. try something like the
following:
sub foo()
dim wbk as workbook

workbooks.open "C:\Documents and Settings\Me\Folder1\file.xls"
set wbk=activeworkbook
'perform your stuff
wbk.saveas "C:\Documents and Settings\Me\Folder2\file.xls"
end sub
 

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