logo
search
VBA & Macro Problems

How to Retrieve Content Created Date in Excel VBA

Kushani NimanthikaKushani Nimanthika Sep 25, 2026 869 views

Question details

The user needs a VBA macro to extract the original document 'Content Created' date instead of the file-system creation date.

How to Retrieve the Content Created Date from an Excel File Using VBA
Product
Excel
Device & OS
not provided
Scenario
Automating file metadata extraction to audit document origins and track when the Office document was actually generated.
Observed behavior
Using FileSystemObject.DateCreated returns the file's disk creation date (e.g., when it was copied or downloaded), failing to retrieve the original 'Content Created' metadata visible in Windows File Explorer details.
Before you start

Ensure you have the Developer tab enabled in your spreadsheet application to access the VBA Editor. Keep in mind that accessing an Office document's built-in properties requires your macro to temporarily open the target workbook.

Solution 1Recommended

Use BuiltinDocumentProperties to Retrieve the Origin Date

Access the original document creation timestamp stored directly within the Office file's internal metadata, bypassing the inaccurate Windows file-system timestamp.

The 'Content Created' property is inherently tied to the Office document itself, not the file system. Because FileSystemObject interacts strictly with the disk, it only knows when the file was written to the current drive. To fetch the actual origin date, you must interact with the workbook's internal property collection.

1
Open the VBA Editor

Press Alt + F11 in your spreadsheet application to open the Visual Basic for Applications (VBA) window.

2
Insert a New Module

Right-click on your VBAProject in the Project Explorer panel, select 'Insert', and choose 'Module'.

3
Write the Property Extraction Macro

Write a macro that opens the target workbook using Workbooks.Open("C:\path\to\your\file.xlsx"). Then, declare a variable to store the date and assign it using: myDate = ActiveWorkbook.BuiltinDocumentProperties("Creation Date").Value.

4
Output the Result and Close

Display the retrieved date using a MsgBox or write it to a specific cell in your main workbook. Finally, use ActiveWorkbook.Close False to close the target file without saving any unintended changes.

Use BuiltinDocumentProperties to Retrieve the Origin Date
Accurate Metadata Retrieval: This method accurately retrieves the true Office document origin date, matching exactly what you see under the 'Content Created' field in Windows File Explorer.
Advanced Macro Support

Execute VBA Macros Seamlessly with WPS Spreadsheet

WPS Spreadsheet offers robust support for VBA macros, allowing you to read, manipulate, and extract BuiltinDocumentProperties just like Microsoft Excel. It's a lightweight, efficient environment perfect for automating document metadata tasks.

  1. 1. Launch WPS Spreadsheet: Open WPS Office and start a new or existing Spreadsheet document.
  2. 2. Access the VBA Editor: Navigate to the 'Tools' tab on the ribbon and click on 'Macro', or simply press Alt + F11 to open the WPS VBA Editor.
  3. 3. Run Your Metadata Macro: Insert a new module, paste your BuiltinDocumentProperties macro code, and click 'Run' to extract the original document creation dates effortlessly.
Fully compatible with Microsoft Excel VBA syntax and BuiltinDocumentPropertiesSeamlessly handles macro-enabled formats like .xlsm and .xlsbFree and lightweight Microsoft Office alternative with a familiar user interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does FileSystemObject give the wrong creation date?

FileSystemObject interacts with the Windows file system. When a file is downloaded, copied, or transferred to a new drive, Windows assigns a new 'creation date' for that specific file instance on the disk. It ignores the internal Office metadata which tracks the original authoring date.

Can I retrieve other document properties using this VBA method?

Yes. The BuiltinDocumentProperties collection contains standard metadata fields such as 'Author', 'Last Save Time', 'Title', and 'Manager'. You can extract them by changing the string name inside the BuiltinDocumentProperties parenthesis.

Do I have to open the Excel workbook to read its BuiltinDocumentProperties?

Yes, standard Excel VBA requires the workbook object to be loaded into memory to access its internal properties. If you need to read the date without fully opening the UI, you can open the workbook in the background by setting Application.ScreenUpdating = False before running the open command.