Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default DateLastModified property date extraction

I am trying to extract the DATE part of a file using the DateLastModified
property. Anyone experience of doing this?

It appears I need to define the file as an object first then read the object
property, and finally extract the date string.

TIA
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default DateLastModified property date extraction

Nigel,

in Tools/References set a reference to "Microsoft Scripting Runtime"

Then:

Sub GetFileMod()
Dim oFS As New Scripting.FileSystemObject
Dim oFL As Scripting.File
Set oFL = oFS.GetFile("test1.xls")
MsgBox oFL.DateLastModified

End Sub

keepITcool

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


"Nigel" wrote:

I am trying to extract the DATE part of a file using the
DateLastModified property. Anyone experience of doing this?

It appears I need to define the file as an object first then read the
object property, and finally extract the date string.

TIA
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
News==---- http://www.newsfeed.com The #1 Newsgroup Service in the
World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers
- Total Privacy via Encryption =---


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default DateLastModified property date extraction

Nigel,

If you don't have a reference to the Scripting Runtime Library, go to the
Tools menu, choose References, find "Scripting Runtime Library" and check
it. Then, use code like


Dim FSO As Scripting.FileSystemObject
Dim F As Scripting.File
Set FSO = New Scripting.FileSystemObject
Set F = FSO.GetFile(ThisWorkbook.FullName)
Debug.Print Int(F.DateLastModified)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Nigel" wrote in message
...
I am trying to extract the DATE part of a file using the DateLastModified
property. Anyone experience of doing this?

It appears I need to define the file as an object first then read the

object
property, and finally extract the date string.

TIA
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default DateLastModified property date extraction

That's got it, thanks a lot

"keepitcool" wrote in message
...
Nigel,

in Tools/References set a reference to "Microsoft Scripting Runtime"

Then:

Sub GetFileMod()
Dim oFS As New Scripting.FileSystemObject
Dim oFL As Scripting.File
Set oFL = oFS.GetFile("test1.xls")
MsgBox oFL.DateLastModified

End Sub

keepITcool

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


"Nigel" wrote:

I am trying to extract the DATE part of a file using the
DateLastModified property. Anyone experience of doing this?

It appears I need to define the file as an object first then read the
object property, and finally extract the date string.

TIA
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
News==---- http://www.newsfeed.com The #1 Newsgroup Service in the
World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers
- Total Privacy via Encryption =---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default DateLastModified property date extraction

Chip,

Thanks for your help again, to illuminate my understanding further, I found
the "Microsoft Scripting Runtime" in my system (XP SP2 & Excel SP2), however
will this code run in NT4 / Excel 97 which is my target system ?

TIA
Nigel


"Chip Pearson" wrote in message
...
Nigel,

If you don't have a reference to the Scripting Runtime Library, go to the
Tools menu, choose References, find "Scripting Runtime Library" and check
it. Then, use code like


Dim FSO As Scripting.FileSystemObject
Dim F As Scripting.File
Set FSO = New Scripting.FileSystemObject
Set F = FSO.GetFile(ThisWorkbook.FullName)
Debug.Print Int(F.DateLastModified)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Nigel" wrote in message
...
I am trying to extract the DATE part of a file using the

DateLastModified
property. Anyone experience of doing this?

It appears I need to define the file as an object first then read the

object
property, and finally extract the date string.

TIA
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default DateLastModified property date extraction

Nigel,

I believe that the Scripting Runtime Library is installed by Internet
Explorer version 5, so if you have IE5 or later on the system, it should
work fine.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Nigel" wrote in message
...
Chip,

Thanks for your help again, to illuminate my understanding further, I

found
the "Microsoft Scripting Runtime" in my system (XP SP2 & Excel SP2),

however
will this code run in NT4 / Excel 97 which is my target system ?

TIA
Nigel


"Chip Pearson" wrote in message
...
Nigel,

If you don't have a reference to the Scripting Runtime Library, go to

the
Tools menu, choose References, find "Scripting Runtime Library" and

check
it. Then, use code like


Dim FSO As Scripting.FileSystemObject
Dim F As Scripting.File
Set FSO = New Scripting.FileSystemObject
Set F = FSO.GetFile(ThisWorkbook.FullName)
Debug.Print Int(F.DateLastModified)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Nigel" wrote in message
...
I am trying to extract the DATE part of a file using the

DateLastModified
property. Anyone experience of doing this?

It appears I need to define the file as an object first then read the

object
property, and finally extract the date string.

TIA
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World!

100,000
Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default DateLastModified property date extraction

These show the API approach:

http://support.microsoft.com/default...76&Product=vb6
HOWTO: Search Directories to Find or List Files

http://support.microsoft.com/default...21&Product=vb6
HOWTO: Get Extended File Time Information Using the Win32 API

--
Regards,
Tom Ogilvy

Nigel wrote in message
...
Chip,

Thanks for your help again, to illuminate my understanding further, I

found
the "Microsoft Scripting Runtime" in my system (XP SP2 & Excel SP2),

however
will this code run in NT4 / Excel 97 which is my target system ?

TIA
Nigel


"Chip Pearson" wrote in message
...
Nigel,

If you don't have a reference to the Scripting Runtime Library, go to

the
Tools menu, choose References, find "Scripting Runtime Library" and

check
it. Then, use code like


Dim FSO As Scripting.FileSystemObject
Dim F As Scripting.File
Set FSO = New Scripting.FileSystemObject
Set F = FSO.GetFile(ThisWorkbook.FullName)
Debug.Print Int(F.DateLastModified)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Nigel" wrote in message
...
I am trying to extract the DATE part of a file using the

DateLastModified
property. Anyone experience of doing this?

It appears I need to define the file as an object first then read the

object
property, and finally extract the date string.

TIA
Nigel




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World!

100,000
Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


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
How to Use DateLastModified Property in VBA? HROBERTSON Excel Discussion (Misc queries) 3 May 6th 23 03:45 AM
date extraction Donna[_2_] Excel Worksheet Functions 1 February 3rd 10 12:44 AM
Date extraction from data pull M Thran Excel Discussion (Misc queries) 1 August 13th 09 04:37 PM
DateLastModified nina Excel Worksheet Functions 2 March 21st 05 02:11 PM
date extraction howto? solo_razor[_20_] Excel Programming 1 October 30th 03 02:32 PM


All times are GMT +1. The time now is 12:02 AM.

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"