I'm using FileCopy in Excel VBA to copy a file from one folder to another. When I do that, the file loses all the attributes I've added on the summary tab. How can I move or copy a file from one folder to another and retain the attributes?
Can you post your code segment where you're trying to copy the file? I ran a quick test in both VBScript and VBA and it seems to work fine (I had set the Title and Subject of the source spreadsheet):
Set objFSO=CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\Scripts\Book1.xls","C:\Book1.xls",TRUE
The following VBScript shows the values:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
Set objWorkbook = objExcel.Workbooks.Open("C:\Book1.xls")
On Error Resume Next
For Each strProperty in objWorkbook.BuiltInDocumentProperties
Wscript.Echo strProperty.Name & " – " & strProperty.Value
Next
objExcel.Quit
Bookmarks