PDA

View Full Version : Solved: SaveCopyAs query



Remalay
09-19-2006, 01:03 AM
Hi Guys,

My objective is to copy a .xls master workbook from one location into another, without opening the file, (I would assume using 'SaveAsCopy',) but I am unable to determine the way of acheiving this.

This is a part of an initial setup function to copy a master workbook from a server onto the users' destop/selected folder without activating the code within the workbook.

I am presently stuck with an 'IF' in the master workbook, but would rather avoid this with the decision effectively being made within the setup file.

Any :help or suggestions would be most appreciated.

thanks
remalay

mdmackillop
09-19-2006, 03:59 AM
Use FileCopy.

From the Excel VBA Help

FileCopy Statement Example

This example uses the FileCopy statement to copy one file to another. For purposes of this example, assume that SRCFILE is a file containing some data.

Dim SourceFile, DestinationFile
SourceFile = "SRCFILE" ' Define source file name.
DestinationFile = "DESTFILE" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.

Remalay
09-20-2006, 12:48 AM
Thanks mdmackillop, :thumb works a treat. Perhaps I should have seen it, but I use my inexeperience as an excuse. Thanks again for your help.

rgds
remalay

mdmackillop
09-20-2006, 04:09 AM
No problem. We can all forget the name of the little utilities. I know it's there somewhere, but can I find it? :banghead: