Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default getting the date a directory was created

Hi,

I want to be able to find out the data that a directory
was created using VBA. Is it possible?

Thanks for any help,

Steven
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default getting the date a directory was created

active the Microsoft Scripting Runtime in references

then
Sub DirDate()
Dim fso As New Scripting.FileSystemObject
Dim fld As Scripting.Folder
Set fld = fso.GetFolder("c:\windows")
MsgBox fld.DateCreated
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Steven Revell" wrote:

Hi,

I want to be able to find out the data that a directory
was created using VBA. Is it possible?

Thanks for any help,

Steven


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default getting the date a directory was created

I get an error "object variable or with variable not set"
at this line:

Set fld = fso.GetFolder("c:\windows")

Cheers for the help,
Steven


-----Original Message-----
active the Microsoft Scripting Runtime in references

then
Sub DirDate()
Dim fso As New Scripting.FileSystemObject
Dim fld As Scripting.Folder
Set fld = fso.GetFolder("c:\windows")
MsgBox fld.DateCreated
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Steven Revell" wrote:

Hi,

I want to be able to find out the data that a directory
was created using VBA. Is it possible?

Thanks for any help,

Steven


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default getting the date a directory was created

Did you create a reference to the Microsoft Scripting Runtime in the
Tools=References portion of the VBE with your workbook as the active
workbook. If not, you need to.


"Steven Revell" wrote in message
...
I get an error "object variable or with variable not set"
at this line:

Set fld = fso.GetFolder("c:\windows")

Cheers for the help,
Steven


-----Original Message-----
active the Microsoft Scripting Runtime in references

then
Sub DirDate()
Dim fso As New Scripting.FileSystemObject
Dim fld As Scripting.Folder
Set fld = fso.GetFolder("c:\windows")
MsgBox fld.DateCreated
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Steven Revell" wrote:

Hi,

I want to be able to find out the data that a directory
was created using VBA. Is it possible?

Thanks for any help,

Steven


.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default getting the date a directory was created

This worked if you don't want to create the reference:

Sub DirDate1()
Dim fso As Object
Dim fld As Object
Set fso = CreateObject("Scripting.Filesystemobject")
Set fld = fso.GetFolder("c:\winnt")
MsgBox fld.DateCreated
End Sub

nonetheless, either with a reference or without, I couldn't duplicate your
error message with either verions of the code. If the directory didn't
exist, I got a 76 error (path not found) and if I didn't have the reference
and used the original, I got a undefined type error.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
Did you create a reference to the Microsoft Scripting Runtime in the
Tools=References portion of the VBE with your workbook as the active
workbook. If not, you need to.


"Steven Revell" wrote in message
...
I get an error "object variable or with variable not set"
at this line:

Set fld = fso.GetFolder("c:\windows")

Cheers for the help,
Steven


-----Original Message-----
active the Microsoft Scripting Runtime in references

then
Sub DirDate()
Dim fso As New Scripting.FileSystemObject
Dim fld As Scripting.Folder
Set fld = fso.GetFolder("c:\windows")
MsgBox fld.DateCreated
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Steven Revell" wrote:

Hi,

I want to be able to find out the data that a directory
was created using VBA. Is it possible?

Thanks for any help,

Steven


.







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default getting the date a directory was created

I hadn't done it for the activeworkbook. I had a different workbook
selected when i added the reference.

Thanks for your help Tom and KeepItCool

Steven Revell
Applications Development & Support
Covance Laboratories Europe, UK

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unknown excel backup files created in network directory Mike Excel Discussion (Misc queries) 0 September 18th 07 01:26 PM
Change of auto backup directory has created problem George NS Excel Discussion (Misc queries) 2 December 30th 06 08:06 PM
file save error: the file or directory cannot be created dublg Excel Discussion (Misc queries) 1 September 25th 06 07:07 PM
Can't delete directory created by a macro ... M C Excel Programming 1 August 8th 03 11:06 PM
Creating a directory from a date mark Excel Programming 1 July 17th 03 11:10 AM


All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"