Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unknown excel backup files created in network directory | Excel Discussion (Misc queries) | |||
Change of auto backup directory has created problem | Excel Discussion (Misc queries) | |||
file save error: the file or directory cannot be created | Excel Discussion (Misc queries) | |||
Can't delete directory created by a macro ... | Excel Programming | |||
Creating a directory from a date | Excel Programming |