Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

creation date and time

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Creation date and time of a file

Creation date and time of a file

ResolvedVersion 2007

Alain has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course
Access Introduction course
Access Intermediate course
Access Advanced course
Access VBA course
Introduction to Management course

Creation date and time of a file

Hi,

I would like to check if a file was delivered on an FTP server and be able to get its creation date and time in order to do statistics (and assess the different data providers).

Regarding the first point I intend to check if the file exists. However the name of the file will change every day since it will contain a date stamp. This is why I would need to wildcard part of the name.

Then I would like to check the properties of the file to see its creation date and time without opening it. Alternatively and if there is no other easy solution I am happy for Excel to open the file and get its properties.

Please let me know if you have any suggestion.

I thank you in advance for your help.

Alain

RE: Creation date and time of a file

Hi Alain, thanks for your query. What you want to achieve is a good general use of VBA. I would open the file in memory (using an object variable) and access the file properties that way rather than "manually" opening the file. There's a good walkthrough here, involving the creation of a function to do so:

http://excelexperts.com/Creation-Date-of-Excel-File

Hope this helps,

Anthony

RE: Creation date and time of a file

Hi Anthony,

Thanks for your help. This code should be able to do the job.

Alain

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

New Normal Worksheet

Do you want all your worksheets to confirm to a certain look? Then change the Defaults!!!
1. Press Shift+F11 to create a new worksheet
2. Press Ctrl+A to select (higlight) all cells, Press Ctrl+1, make any formatting changes then click OK.
3. Press F12 (Function 12 key) click in the Save As Type, drop down, then select Template (*.xlt)
4. Click in the Save in drop-down, then find the folder; c:_program files_microsoft office_office_start. (For the underscores shown use backslash)
Name your templete sheet.xlt, then press Enter.
Sheet.xlt is used when you insert a new worksheet (Shift+F11)

Note: These changes are permanent changes on your PC.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.08 secs.