Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Getting the creation date of a file

Posted on 2003-11-09
4
Medium Priority
?
431 Views
Last Modified: 2010-05-01
How would one get the creation date of a file in VB6?

   - Marc
0
Comment
Question by:MarcGraff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 11

Expert Comment

by:bingie
ID: 9710322

Add a command button and paste the following code

Private Sub Command1_Click()
   Dim filesys As Object
   Set filesys = CreateObject("Scripting.FileSystemObject")
   Set f = filesys.GetFile(filePath) 'filepath is your file's path
   MsgBox f.DateCreated
End Sub

(above is from AzraSound)
0
 
LVL 11

Accepted Solution

by:
bingie earned 1000 total points
ID: 9710330
Oops - use this instead:

Private Sub Command1_Click()
  Dim f As Object
  Dim filesys As Object
  Set filesys = CreateObject("Scripting.FileSystemObject")
  Set f = filesys.GetFile(filePath) 'filepath is your file's path
  MsgBox f.DateCreated
End Sub
0
 
LVL 11

Expert Comment

by:bingie
ID: 9710337
Also, see this link for info on getting other file information

http://www.mvps.org/vbnet/code/fileapi/filedatetime.htm
0
 
LVL 1

Author Comment

by:MarcGraff
ID: 9710579
Thanks so much!

   - Marc
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question