Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Importing file envelope infomation

If by "envelope" you mean folder, you can use the Scripting.FileSystemObject
to get the various file dates. E.g.,

Sub AAA()
Dim FSO As Object
Dim FF As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FF = FSO.GetFolder("C:\Temp") '<<< CHANGE TO YOUR FOLDER
Debug.Print FF.DateCreated, FF.DateLastAccessed, FF.DateLastModified
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Phil" wrote in message
...
When I import a file I want to include the envelope information, i.e.,
file
name, date and time created, along with each record. How can I do this



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Importing file envelope infomation

Phil,
Depends how you are doing the import, but something along these lines:

Dim FileName As String
Dim strPath As String
Dim FileDate As Date

Const Ext As String = "xyz"

strPath = "C:\SomeFolder\"

FileName = Dir(strPath & "*." & Ext)
Do While FileName < ""
FileDate = FileDateTime(strPath & FileName)
'Do the import
'Or just read the line with the Open statement & Line Input/Input
function
FileName = Dir()
Loop

NickHK

"Phil" wrote in message
...
Thanks Chip, but I want the file info. I want to automate importing 30

files
each day. Each file has one record, but with that record I need to know

when
it was created and the file name (which identifies the record).

And where do you enter that code?

Thanks.

Phil

"Chip Pearson" wrote:

If by "envelope" you mean folder, you can use the

Scripting.FileSystemObject
to get the various file dates. E.g.,

Sub AAA()
Dim FSO As Object
Dim FF As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FF = FSO.GetFolder("C:\Temp") '<<< CHANGE TO YOUR FOLDER
Debug.Print FF.DateCreated, FF.DateLastAccessed, FF.DateLastModified
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Phil" wrote in message
...
When I import a file I want to include the envelope information, i.e.,
file
name, date and time created, along with each record. How can I do

this





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
Excel file opens into a blue screen with no infomation Scott S. Excel Discussion (Misc queries) 0 July 15th 09 06:23 PM
Bar graph pop-up infomation pgarcia Charts and Charting in Excel 1 April 9th 08 05:40 PM
need more infomation on scatter charts? zaka Charts and Charting in Excel 3 April 25th 06 10:45 AM
Match Infomation Trying Hard Excel Worksheet Functions 1 October 27th 05 02:24 PM
populate infomation from one worksheet to another if one of the c. Barbara Excel Worksheet Functions 1 March 17th 05 07:14 PM


All times are GMT +1. The time now is 11:37 PM.

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

About Us

"It's about Microsoft Excel"