May 4th, 2011, 12:24 PM
Copying a file with attributes
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?
May 31st, 2011, 09:54 AM
Re: Copying a file with 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):
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
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.