VBA Copy "Creation Date" Metadata to Another Workbook.

Shiseiji

Board Regular
Joined
Oct 23, 2009
Messages
214
Office Version
  1. 2019
Platform
  1. Windows
I'm copying out a range of data from a report formatted as an .xlsx into my running report. Along with the data, I want to capture the file "Creation Date" metadata to use as the worksheet name. It's also going into the first blank cell in a column range so using that cell for the worksheet name is, to me anyway, as easy as anything else. I found code posted in 2006 ( http://www.mrexcel.com/forum/excel-...properties-doesnt-return-expected-data-2.html ), and added in what I think is correct to get the data to my running report, but my VB skills are about as basic as they come and I can't make it work. The error is on the "cdt =" line
Run-time error '-2147467259 (80004005)':
Automation error
Unspecified error

Public Sub tst_cd()
'm_tst_cd Get file create date for worksheet name and report range
Dim cdt As Date
cdt = ActiveWorkbook.BuiltinDocumentProperties.Item("Creation date")
Workbooks("Investigation_Pending_Running_Report.XLSX").Activate
Worksheets("Report").Activate
Range("D" & Cells.Rows.Count).End(xlUp).Offset(1, 0).Select
Debug.Print cdt
End Sub

As always, with deep appreciation!

Ron
 
Last edited:

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Alibi. File has been opened & saved to ensure it's in an Excel file format.
 
Upvote 0
Arggggg. "Created" field is null!!! Let me know if I should just delete this thread . . .
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,721
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top